添加初始化代码
This commit is contained in:
parent
7de25d3f90
commit
82f667dff0
3
app.py
3
app.py
|
|
@ -12,6 +12,7 @@ from config import settings
|
||||||
from utils.system import host
|
from utils.system import host
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
|
|
||||||
|
|
||||||
def create_app() -> FastAPI:
|
def create_app() -> FastAPI:
|
||||||
logger.info("loading application configuration")
|
logger.info("loading application configuration")
|
||||||
|
|
||||||
|
|
@ -36,7 +37,6 @@ def create_app() -> FastAPI:
|
||||||
allow_headers=["*"],
|
allow_headers=["*"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if settings.PROJECT.DEBUG:
|
if settings.PROJECT.DEBUG:
|
||||||
logger.info("Application started successfully:{}".format(CORSMiddleware.__name__))
|
logger.info("Application started successfully:{}".format(CORSMiddleware.__name__))
|
||||||
logger.info(f"Server address http://{host}:{settings.PROJECT.PORT}")
|
logger.info(f"Server address http://{host}:{settings.PROJECT.PORT}")
|
||||||
|
|
@ -46,4 +46,3 @@ def create_app() -> FastAPI:
|
||||||
|
|
||||||
|
|
||||||
__all__ = ["create_app"]
|
__all__ = ["create_app"]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue