diff --git a/backend/README.md b/backend/README.md index 3e7dc106..61d0663e 100644 --- a/backend/README.md +++ b/backend/README.md @@ -2,6 +2,16 @@ This is the api service that will supply the frontend with the insights that are driven by the machine learning and data modelling services. +# Usage + +## Local + +For running the serice locally, natigate to the backend directory and run the following command: + +```bash +uvicorn main:app --reload +``` + ### Thoughts for authenticating the frontend with the backend To provide secure communication between your frontend Next.js application and your backend FastAPI service, you have several options. Here are a few popular approaches: diff --git a/backend/main.py b/backend/main.py index ee60be1f..35db91d1 100644 --- a/backend/main.py +++ b/backend/main.py @@ -3,6 +3,10 @@ from fastapi import FastAPI app = FastAPI() -@app.get("/") -async def root(): - return {"message": "Hello World"} +@app.get("/portfolio/{portfolio_id}") +async def get_portfolio(portfolio_id: int): + return { + "portfolio_id": portfolio_id, + "name": "My Portfolio", + "description": "This is my portfolio", + }