comparison foodtruck/web.py @ 706:e67da1f7293b

admin: Add support for `.well-known` folder.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 14 May 2016 18:18:54 -0700
parents 65706804e1de
children 3885421c29a3
comparison
equal deleted inserted replaced
705:acd119fda1f7 706:e67da1f7293b
1 import os 1 import os
2 import os.path 2 import os.path
3 import time 3 import time
4 import logging 4 import logging
5 from flask import Flask, g, request, render_template 5 from flask import Flask, g, request, render_template
6 from werkzeug import SharedDataMiddleware
6 from .configuration import ( 7 from .configuration import (
7 FoodTruckConfigNotFoundError, get_foodtruck_config) 8 FoodTruckConfigNotFoundError, get_foodtruck_config)
8 from .sites import FoodTruckSites, InvalidSiteError 9 from .sites import FoodTruckSites, InvalidSiteError
9 10
10 11
28 _procedural_config = { 29 _procedural_config = {
29 'sites': { 30 'sites': {
30 'local': admin_root} 31 'local': admin_root}
31 } 32 }
32 33
34 # Add a special route for the `.well-known` directory.
35 app.wsgi_app = SharedDataMiddleware(
36 app.wsgi_app,
37 {'/.well-known': os.path.join(admin_root, '.well-known')})
33 38
34 if os.path.isfile(config_path): 39 if os.path.isfile(config_path):
35 app.config.from_pyfile(config_path) 40 app.config.from_pyfile(config_path)
36 41
37 if app.config['DEBUG']: 42 if app.config['DEBUG']: