From 000dee1d50c44a10b9616981a992c594e8259493 Mon Sep 17 00:00:00 2001 From: xyaz1313 <12321572@qq.com> Date: Tue, 14 Apr 2026 01:57:43 +0800 Subject: [PATCH 1/2] Add /time endpoint that returns current server time in ISO8601 format --- main.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/main.py b/main.py index 761173c..e69de29 100644 --- a/main.py +++ b/main.py @@ -1,13 +0,0 @@ -from fastapi import FastAPI - -app = FastAPI() - - -@app.get("/") -async def root(): - return {"message": "Hello World"} - - -@app.get("/hello/{name}") -async def say_hello(name: str): - return {"message": f"Hello {name}"} From 46eb31dd3014f041c904a0ab0af2b8385e3d3ca4 Mon Sep 17 00:00:00 2001 From: xyaz1313 <12321572@qq.com> Date: Tue, 14 Apr 2026 01:57:51 +0800 Subject: [PATCH 2/2] Add /time endpoint that returns current server time in ISO8601 format --- main.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/main.py b/main.py index e69de29..1b12172 100644 --- a/main.py +++ b/main.py @@ -0,0 +1,19 @@ +from fastapi import FastAPI +from datetime import datetime + +app = FastAPI() + + +@app.get("/") +async def root(): + return {"message": "Hello World"} + + +@app.get("/hello/{name}") +async def say_hello(name: str): + return {"message": f"Hello {name}"} + + +@app.get("/time") +async def get_time(): + return {"time": datetime.now().isoformat()}