Dynamically-generated manifests.

This commit is contained in:
Ian Gulliver
2016-01-07 20:01:56 -08:00
parent 55f49734ab
commit defbc3d38a
3 changed files with 33 additions and 0 deletions

23
manifest.py Normal file
View File

@@ -0,0 +1,23 @@
import json
import webapp2
class Manifest(webapp2.RequestHandler):
def get(self):
self.response.headers['Content-Type'] = 'application/json'
json.dump({
'name': self.request.get('name'),
'display': 'standalone',
'icons': [
{
'src': '/static/icon.png',
'sizes': '256x256',
},
],
}, self.response.out)
app = webapp2.WSGIApplication([
('/manifest.json', Manifest),
])