-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
40 lines (31 loc) · 985 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
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers.recommender import recommender_router
from routers.position import position_router
from routers.portfolio import portfolio_router
from routers.stock import stock_router
from routers.user import user_router
from routers.crypto import crypto_router
import uvicorn
origins = [
"*",
]
app = FastAPI(title="EmporIO", version="1.0", root_path="/api")
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(recommender_router)
app.include_router(position_router)
app.include_router(portfolio_router)
app.include_router(stock_router)
app.include_router(user_router)
app.include_router(crypto_router)
@app.get("/")
async def root():
return {"message": "Hello World!"}
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True, workers=1)