-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
40 lines (32 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 config.database import Base, engine
from routes import authentication
from routes import organization as organization_route
from routes import user as user_route
from routes import todo as todo_route
from routes import folder as folder_route
from routes import note as note_route
origins = ["*"]
Base.metadata.create_all(bind=engine)
app = FastAPI(
version="0.1.0",
title="Todo App",
description="A simple todo app",
root_path="/v2",
)
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(authentication.router)
app.include_router(user_route.router)
app.include_router(organization_route.router)
app.include_router(folder_route.router)
app.include_router(todo_route.router)
app.include_router(note_route.router)
@app.get("/")
def root():
return {"author": "horlakz", "about": "Todo App"}