From abd6ab78e3436f5387987ae9328e4e855456c7c8 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 27 Mar 2025 20:53:51 +0000 Subject: [PATCH] Add GET endpoint for /num --- endpoints/num.get.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/endpoints/num.get.py b/endpoints/num.get.py index e69de29..9438352 100644 --- a/endpoints/num.get.py +++ b/endpoints/num.get.py @@ -0,0 +1,12 @@ +# Entity: RandomNumber + +from fastapi import APIRouter, status +from typing import Dict +import random + +router = APIRouter() + +@router.get("/num", status_code=200, response_model=Dict[str, int]) +async def get_random_number(): + """Get a random number""" + return {"number": random.randint(1, 100)} \ No newline at end of file