20 lines
No EOL
439 B
Python
20 lines
No EOL
439 B
Python
from typing import Union
|
|
from fastapi import FastAPI
|
|
|
|
from classes.boardgame import BoardGame, BoardGameExpansion
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/")
|
|
def read_root():
|
|
return {"Hello": "World"}
|
|
|
|
|
|
@app.get("/items/{item_id}")
|
|
def read_item(item_id: int, q: Union[str, None] = None):
|
|
return {"item_id": item_id, "q": q}
|
|
|
|
@app.get("/boardgame/{boardgame_id}", response_model=BoardGame)
|
|
def get_boardgame_by_id(boardgame_id: int):
|
|
pass |