File size: 618 Bytes
2efe16a
 
a33a28a
 
2efe16a
a33a28a
2efe16a
77616cb
 
a33a28a
 
 
 
2efe16a
a33a28a
 
 
 
 
2efe16a
 
a33a28a
2efe16a
a33a28a
 
 
 
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
# app/main.py

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware

from app.api.routes import router
from app.api.routes_stream import router as stream_router


app = FastAPI(title="SmartNotes Backend")

app.add_middleware(
    CORSMiddleware,
    allow_origins=["http://localhost:5173"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

# app.include_router(router, prefix="/api")

app.include_router(router, prefix="/api")
app.include_router(stream_router, prefix="/api")

@app.get("/")
def root():
    return {"message": "SmartNotes API is running 🚀"}