PWA-Unterstützung hinzugefügt: manifest.webmanifest, Service Worker, Installierbarkeit auf Homescreen/Desktop

This commit is contained in:
2025-08-19 12:58:47 +02:00
parent b2cd91b970
commit c93a813c96
4 changed files with 78 additions and 1 deletions

13
app.py
View File

@@ -1,7 +1,7 @@
from pathlib import Path
import json
from typing import Tuple, Dict, List
from flask import Flask, render_template, request
from flask import Flask, render_template, request, send_from_directory
app = Flask(__name__)
@@ -77,5 +77,16 @@ def index():
)
@app.route('/manifest.webmanifest')
def manifest_file():
return send_from_directory(Path(__file__).parent / 'static', 'manifest.webmanifest', mimetype='application/manifest+json')
@app.route('/sw.js')
def service_worker():
# Service Worker muss auf Top-Level liegen
return send_from_directory(Path(__file__).parent / 'static', 'sw.js', mimetype='application/javascript')
if __name__ == "__main__":
app.run(debug=True)