raghavNCI
commited on
Commit
·
3be496d
1
Parent(s):
e9f4038
routes file added
Browse files
app.py
CHANGED
@@ -1,7 +1,9 @@
|
|
1 |
from fastapi import FastAPI
|
|
|
2 |
|
3 |
app = FastAPI()
|
|
|
4 |
|
5 |
-
@app.get("/")
|
6 |
-
def
|
7 |
-
return {"
|
|
|
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"}
|