basic portfolio api

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-06 10:24:06 +01:00
parent d9de9cf67e
commit 28a5f3bdee
2 changed files with 17 additions and 3 deletions

View file

@ -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:

View file

@ -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",
}