raghavNCI commited on
Commit
3be496d
·
1 Parent(s): e9f4038

routes file added

Browse files
Files changed (2) hide show
  1. app.py +5 -3
  2. routes.py +11 -0
app.py CHANGED
@@ -1,7 +1,9 @@
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 routes import router # routes.py must be in same folder
3
 
4
  app = FastAPI()
5
+ app.include_router(router)
6
 
7
+ @app.get("/health")
8
+ def health_check():
9
+ return {"status": "ok"}
routes.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastapi import APIRouter
2
+
3
+ router = APIRouter()
4
+
5
+ @router.get("/")
6
+ async def root():
7
+ return {"message": "LucidFeed backend is up and running!"}
8
+
9
+ @router.get("/ping")
10
+ async def ping():
11
+ return {"message": "pong"}