mgbam commited on
Commit
ce0b1fc
·
verified ·
1 Parent(s): eee1f4d

Upload main.py

Browse files
Files changed (1) hide show
  1. app/main.py +12 -4
app/main.py CHANGED
@@ -1,10 +1,19 @@
1
  from fastapi import FastAPI
 
2
 
3
- from app.api import ecg
4
  from app.db.session import close_engine, init_db
5
 
6
  app = FastAPI(title="Sundew Health API", version="0.1.0")
7
 
 
 
 
 
 
 
 
 
8
 
9
  @app.on_event("startup")
10
  def on_startup() -> None:
@@ -18,10 +27,9 @@ def on_shutdown() -> None:
18
 
19
  @app.get("/health", tags=["meta"])
20
  async def health_check() -> dict:
21
- """
22
- Simple health endpoint to verify the API is running.
23
- """
24
  return {"status": "ok"}
25
 
26
 
27
  app.include_router(ecg.router, prefix="/ecg", tags=["ecg"])
 
 
 
1
  from fastapi import FastAPI
2
+ from fastapi.middleware.cors import CORSMiddleware
3
 
4
+ from app.api import ecg, streaming, dashboard
5
  from app.db.session import close_engine, init_db
6
 
7
  app = FastAPI(title="Sundew Health API", version="0.1.0")
8
 
9
+ app.add_middleware(
10
+ CORSMiddleware,
11
+ allow_origins=["*"],
12
+ allow_credentials=True,
13
+ allow_methods=["*"],
14
+ allow_headers=["*"],
15
+ )
16
+
17
 
18
  @app.on_event("startup")
19
  def on_startup() -> None:
 
27
 
28
  @app.get("/health", tags=["meta"])
29
  async def health_check() -> dict:
 
 
 
30
  return {"status": "ok"}
31
 
32
 
33
  app.include_router(ecg.router, prefix="/ecg", tags=["ecg"])
34
+ app.include_router(streaming.router, tags=["streaming"])
35
+ app.include_router(dashboard.router, prefix="/dashboard", tags=["dashboard"])