-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (29 loc) · 817 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import uvicorn
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.authApp import authApp
from middlewares import Middlewares
app = FastAPI(prefix="/api/v1", docs_url="/docs", openapi_url="/openapi.json",
redoc_url="/redoc")
origins = ["*"]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
authApp.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
authApp.add_middleware(Middlewares)
app.mount("/authApp", authApp)
@app.get("/")
async def root():
return {"status": "true"}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000, reload=True)