11 lines
332 B
Python

from fastapi import APIRouter, status
from typing import List
from helpers.fruit_helpers import get_all_fruit_names
router = APIRouter()
@router.post("/names", status_code=status.HTTP_200_OK, response_model=List[str])
async def get_fruit_names():
"""Return all fruit names"""
names = get_all_fruit_names()
return names