10 lines
334 B
Python
10 lines
334 B
Python
from fastapi import APIRouter, status
|
|
from datetime import datetime
|
|
from typing import Dict
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/colour", status_code=status.HTTP_200_OK, response_model=Dict[str, str])
|
|
async def get_server_time():
|
|
current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
|
|
return {"server_time": current_time} |