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 This is the api service that will supply the frontend with the insights that are driven by the machine
learning and data modelling services. 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 ### 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: 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 = FastAPI()
@app.get("/") @app.get("/portfolio/{portfolio_id}")
async def root(): async def get_portfolio(portfolio_id: int):
return {"message": "Hello World"} return {
"portfolio_id": portfolio_id,
"name": "My Portfolio",
"description": "This is my portfolio",
}