support app factory patten in CLI (#2157)
* support app factory patten in CLI * Update sanic/__main__.py * fix mypy errors * Update mypy further * Update sanic/utils.py * Update sanic/utils.py * support hypercorn/gunicorn style 'asgi.app:create_app()' * add test for app factory
This commit is contained in:
@@ -30,3 +30,7 @@ async def app_info_dump(app: Sanic, _):
|
||||
@app.after_server_start
|
||||
async def shutdown(app: Sanic, _):
|
||||
app.stop()
|
||||
|
||||
|
||||
def create_app():
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user