def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--occlude-root', action='store_true',
help='Add an explicit handler function for /.')
args = parser.parse_args()
app = web.Application(middlewares=[IndexMiddleware()])
app.router.add_route('GET', '/test/', make_handler('test'))
if args.occlude_root:
app.router.add_route('GET', '/', make_handler('I occluded /index.html.'))
app.router.add_static('/', APP_PATH / 'static')
web.run_app(app)
评论列表
文章目录