10 lines
267 B
Python
10 lines
267 B
Python
from fastapi import APIRouter, status
|
|
from typing import List
|
|
|
|
router = APIRouter()
|
|
|
|
fruits = ["apple", "banana", "orange", "grape", "mango"]
|
|
|
|
@router.get("/endpoint", status_code=status.HTTP_200_OK, response_model=List[str])
|
|
async def get_fruits():
|
|
return fruits |