mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2025-08-17 22:21:35 +08:00
36 lines
1.1 KiB
Python
36 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
import uvicorn
|
|
|
|
from path import Path
|
|
|
|
from backend.app.common.log import log
|
|
from backend.app.core.conf import settings
|
|
from backend.app.core.registrar import register_app
|
|
|
|
app = register_app()
|
|
|
|
if __name__ == '__main__':
|
|
try:
|
|
log.info(
|
|
"""\n
|
|
/$$$$$$$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$
|
|
| $$_____/ | $$ /$$__ $$| $$__ $$|_ $$_/
|
|
| $$ /$$$$$$ /$$$$$$$ /$$$$$$ | $$ | $$| $$ | $$ | $$
|
|
| $$$$$|____ $$ /$$_____/|_ $$_/ | $$$$$$$$| $$$$$$$/ | $$
|
|
| $$__/ /$$$$$$$| $$$$$$ | $$ | $$__ $$| $$____/ | $$
|
|
| $$ /$$__ $$ |____ $$ | $$ /$$| $$ | $$| $$ | $$
|
|
| $$ | $$$$$$$ /$$$$$$$/ | $$$$/| $$ | $$| $$ /$$$$$$
|
|
|__/ |_______/|_______/ |___/ |__/ |__/|__/ |______/
|
|
|
|
"""
|
|
)
|
|
uvicorn.run(
|
|
app=f'{Path(__file__).stem}:app',
|
|
host=settings.UVICORN_HOST,
|
|
port=settings.UVICORN_PORT,
|
|
reload=settings.UVICORN_RELOAD,
|
|
)
|
|
except Exception as e:
|
|
log.error(f'❌ FastAPI start filed: {e}')
|