mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-24 10:17:15 +08:00
19 lines
432 B
Python
19 lines
432 B
Python
from api.utils.common_log import myLogger
|
|
|
|
import api.v1.api as api_router_v1
|
|
import uvicorn
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
myLogger.info_logger("Starting server")
|
|
|
|
def get_app():
|
|
app = FastAPI()
|
|
|
|
app.include_router(api_router_v1.get_api(), prefix="/api/v1")
|
|
return app
|
|
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run("main:get_app", host='0.0.0.0', port=5000, reload=True)
|