-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
35 lines (27 loc) · 871 Bytes
/
main.py
File metadata and controls
35 lines (27 loc) · 871 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
from __future__ import annotations
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from api.browse_api import router as browse_router
from api.graph_api import router as graph_router
from api.model_api import router as model_router
from api.projects import router as projects_router
app = FastAPI(title="Code Graph Builder", version="1.0.0")
app.add_middleware(
CORSMiddleware,
allow_origins=[
"http://127.0.0.1:3000",
"http://localhost:3000",
"http://127.0.0.1:5173",
"http://localhost:5173",
],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
@app.get("/api/health")
async def health() -> dict:
return {"ok": True}
app.include_router(projects_router)
app.include_router(graph_router)
app.include_router(model_router)
app.include_router(browse_router)