Update code in endpoints/months.get.py
This commit is contained in:
parent
629fba2836
commit
f8f036071e
@ -0,0 +1,15 @@
|
||||
from fastapi import APIRouter, status
|
||||
from typing import Dict
|
||||
import random
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/months", status_code=status.HTTP_200_OK, response_model=Dict[str, str])
|
||||
async def get_random_month():
|
||||
months = [
|
||||
"January", "February", "March", "April",
|
||||
"May", "June", "July", "August",
|
||||
"September", "October", "November", "December"
|
||||
]
|
||||
random_month = random.choice(months)
|
||||
return {"month": random_month}
|
Loading…
x
Reference in New Issue
Block a user