From c0292a63f388357027805dc833c01b74356fd1f6 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 8 Sep 2026 17:06:26 +0000 Subject: [PATCH] Update app.py added product endpoint --- app.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 6ca2bba..b951051 100644 --- a/app.py +++ b/app.py @@ -1,7 +1,14 @@ from fastapi import FastAPI +import json app = FastAPI() @app.get("/") def home(): - return {"message": "Welcome to DemoTel Product Catalog"} \ No newline at end of file + 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 \ No newline at end of file