Initial commit
This commit is contained in:
commit
983cee0320
322 changed files with 57174 additions and 0 deletions
22
backup/first -fina app/app/pwa.py
Normal file
22
backup/first -fina app/app/pwa.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""
|
||||
Add route to serve service worker from root
|
||||
"""
|
||||
from flask import send_from_directory
|
||||
import os
|
||||
|
||||
def register_pwa_routes(app):
|
||||
@app.route('/service-worker.js')
|
||||
def service_worker():
|
||||
return send_from_directory(
|
||||
os.path.join(app.root_path, 'static', 'js'),
|
||||
'service-worker.js',
|
||||
mimetype='application/javascript'
|
||||
)
|
||||
|
||||
@app.route('/manifest.json')
|
||||
def manifest():
|
||||
return send_from_directory(
|
||||
os.path.join(app.root_path, 'static'),
|
||||
'manifest.json',
|
||||
mimetype='application/json'
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue