mirror of
https://github.com/ThePhaseless/Byparr.git
synced 2025-03-15 01:40:21 +08:00
22 lines
535 B
Python
22 lines
535 B
Python
from __future__ import annotations
|
|
|
|
import logging
|
|
|
|
import uvicorn
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.gzip import GZipMiddleware
|
|
|
|
from src.consts import LOG_LEVEL
|
|
from src.endpoints import router
|
|
from src.middlewares import LogRequest
|
|
|
|
app = FastAPI(debug=LOG_LEVEL == logging.DEBUG, log_level=LOG_LEVEL)
|
|
app.add_middleware(GZipMiddleware)
|
|
app.add_middleware(LogRequest)
|
|
|
|
app.include_router(router=router)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run(app, host="0.0.0.0", port=8191, log_level=LOG_LEVEL) # noqa: S104
|