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