Kaballas commited on
Commit
2617623
Β·
1 Parent(s): efec128
Files changed (1) hide show
  1. app.py +14 -3
app.py CHANGED
@@ -1,7 +1,18 @@
1
  from fastapi import FastAPI
 
2
 
 
3
  app = FastAPI()
4
 
5
- @app.get("/")
6
- def greet_json():
7
- return {"Hello": "World!"}
 
 
 
 
 
 
 
 
 
 
1
  from fastapi import FastAPI
2
+ from fastmcp import create_server # ➊ import the FastMCP factory
3
 
4
+ # ── Parent FastAPI app ───────────────────────────────────────────
5
  app = FastAPI()
6
 
7
+ # ── Mount the existing FastMCP server under /sse/ ────────────────
8
+ #
9
+ # FastMCP already returns a FastAPI/Starlette app, so you can plug it
10
+ # straight into your main application.
11
+ #
12
+ vector_app = create_server(transport="sse") # keep any flags you need
13
+ app.mount("/sse", vector_app) # /sse/ now serves the API
14
+
15
+ # ── Minimal health-check route for Hugging Face and Docker ───────
16
+ @app.get("/", tags=["health"])
17
+ async def root():
18
+ return {"status": "ok"}