attribute 字段名规范
This commit is contained in:
39
app/main.py
39
app/main.py
@@ -1,39 +0,0 @@
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
|
||||
import logging.config
|
||||
|
||||
from app.api.api_route import router
|
||||
from app.core.config import settings
|
||||
|
||||
from logging_env import LOGGER_CONFIG_DICT
|
||||
|
||||
logging.config.dictConfig(LOGGER_CONFIG_DICT)
|
||||
|
||||
from starlette.middleware.cors import CORSMiddleware
|
||||
|
||||
|
||||
def get_application() -> FastAPI:
|
||||
application = FastAPI(
|
||||
title=settings.PROJECT_NAME, docs_url="/docs", redoc_url='/re-docs',
|
||||
openapi_url=f"{settings.API_PREFIX}/openapi.json",
|
||||
description='''
|
||||
Base frame with FastAPI
|
||||
- out_matcher_hon API
|
||||
|
||||
'''
|
||||
)
|
||||
application.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=[str(origin) for origin in settings.BACKEND_CORS_ORIGINS],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
application.include_router(router=router, prefix=settings.API_PREFIX)
|
||||
return application
|
||||
|
||||
|
||||
app = get_application()
|
||||
if __name__ == '__main__':
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||
Reference in New Issue
Block a user