32 lines
673 B
Python
32 lines
673 B
Python
from fastapi import APIRouter
|
|
import random
|
|
|
|
songs = [
|
|
"The Greatest Show",
|
|
"A Million Dreams",
|
|
"Come Alive",
|
|
"The Other Side",
|
|
"Never Enough",
|
|
"This Is Me",
|
|
"Rewrite The Stars",
|
|
"Tightrope",
|
|
"From Now On"
|
|
]
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/greatest-showman")
|
|
async def random_showman_song():
|
|
"""Get a random song from The Greatest Showman"""
|
|
song = random.choice(songs)
|
|
|
|
return {
|
|
"message": "Random song retrieved",
|
|
"song": song,
|
|
"method": "GET",
|
|
"_verb": "get",
|
|
"features": {
|
|
"total_songs": len(songs),
|
|
"movie": "The Greatest Showman"
|
|
}
|
|
} |