Mobile Views jetzt als PWA
This commit is contained in:
1 parent
d8692ab20e
commit
b41c3bc3a6
11 files changed
+785
-37
No files matched your search
@@ -96,6 +96,18 @@ def create_app(config_name=None):
|
||||
app.static_folder, 'favicon.ico', mimetype='image/vnd.microsoft.icon'
|
||||
)
|
||||
|
||||
# Service Worker für die PWA. Er wird bewusst an der App-Wurzel
|
||||
# ausgeliefert, damit er auch die statischen Assets unter /static
|
||||
# kontrollieren kann. Der Pfad berücksichtigt ein gesetztes SCRIPT_NAME
|
||||
# (Reverse-Proxy-Prefix) automatisch.
|
||||
@app.route('/sw.js')
|
||||
def service_worker():
|
||||
response = send_from_directory(
|
||||
app.static_folder, 'js/sw.js', mimetype='application/javascript'
|
||||
)
|
||||
response.headers['Cache-Control'] = 'no-cache'
|
||||
return response
|
||||
|
||||
# Root redirect
|
||||
@app.route('/')
|
||||
def index():
|
||||
|
||||
Reference in new issue
Block a user