-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
43 lines (31 loc) · 858 Bytes
/
main.py
File metadata and controls
43 lines (31 loc) · 858 Bytes
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
41
42
43
from dotenv import load_dotenv
import routers.forums
# import websocket
load_dotenv()
import routers.events
import routers.user
import routers.teams
import routers.college
import routers.skill
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from database import *
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(routers.user.router)
app.include_router(routers.events.router)
app.include_router(routers.teams.router)
app.include_router(routers.college.router)
app.include_router(routers.skill.router)
app.include_router(routers.forums.router)
# app.include_router(websocket.router)
create_db_and_tables()
@app.get("/")
async def root():
return {"message": "server is running..."}