mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2026-03-13 09:31:31 +08:00
* 🦄 refactor: optimize log output Unified log output using the loguru logging library * 🌈 style: pre-commit fix * 🌈 style: pre-commit fix * Clean up and update some code * Update default log output style
21 lines
559 B
Python
21 lines
559 B
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
from pathlib import Path
|
||
|
||
import uvicorn
|
||
|
||
from backend.core.registrar import register_app
|
||
|
||
app = register_app()
|
||
|
||
|
||
if __name__ == '__main__':
|
||
# 如果你喜欢在 IDE 中进行 DEBUG,main 启动方法会很有帮助
|
||
# 如果你喜欢通过 print 方式进行调试,建议使用 fastapi cli 方式启动服务
|
||
try:
|
||
config = uvicorn.Config(app=f'{Path(__file__).stem}:app', reload=True)
|
||
server = uvicorn.Server(config)
|
||
server.run()
|
||
except Exception as e:
|
||
raise e
|