def run(self):
views.create_views(self)
app_root = self.flask.config.get("APPLICATION_ROOT")
if app_root:
def simple(env, resp):
resp(b'200 OK', [(b'Content-Type', b'text/html')])
return [b'<a href="{root}">{root}</a>'.format(root=app_root)]
print self.flask.config["APPLICATION_ROOT"]
self.flask.wsgi_app = DispatcherMiddleware(simple, {
self.flask.config["APPLICATION_ROOT"]: self.flask.wsgi_app
})
# Add extra files
extra_files = []
for (root, _, files) in os.walk(os.path.join(const.PUSH_WEB_DIR, "templates")):
extra_files.extend(os.path.join(root, f) for f in files)
self.flask.run(self.host, self.port, debug=self.debug, extra_files=extra_files)
评论列表
文章目录