Update code in endpoints/colour.get.py

This commit is contained in:
Backend IM Bot 2025-03-28 18:33:24 +00:00
parent 0fd4948398
commit 7ae53e2620

View File

@ -1,11 +1,10 @@
from fastapi import APIRouter, status
from datetime import datetime
from schemas.time import TimeSchema
from fastapi import APIRouter, HTTPException, status
from typing import List
router = APIRouter()
@router.get("/colour", status_code=200, response_model=TimeSchema)
async def get_server_time():
"""Get current server time"""
current_time = datetime.now()
return {"timestamp": current_time}
@router.get("/colour", status_code=200)
async def get_colour():
"""Get a list of colours"""
colours = ["red", "blue", "green", "yellow", "purple", "orange"]
return {"colours": colours}