[core] Fix production issues

This commit is contained in:
Cathy Hu 2020-09-10 22:57:05 +02:00
parent 28396eb379
commit 96b1900b46

View file

@ -59,7 +59,9 @@ class Main:
server_config.accesslog = '-'
if config['production']:
server_config.bind = ['0.0.0.0:8000', '[::]:8000']
app.include_router(router, prefix='/api')
api = FastAPI()
api.include_router(router)
app.mount('/api', api)
if not config['production'] and config['cors_allow_origin']:
app.add_middleware(
CORSMiddleware,