Update app.py

added product endpoint
This commit is contained in:
2026-09-08 17:06:26 +00:00
parent 75920994e8
commit c0292a63f3
+8 -1
View File
@@ -1,7 +1,14 @@
from fastapi import FastAPI
import json
app = FastAPI()
@app.get("/")
def home():
return {"message": "Welcome to DemoTel Product Catalog"}
return {"message": "Welcome to DemoTel Product Catalog"}
@app.get("/products")
def get_products():
with open("products.json", "r") as file:
products = json.load(file)
return products