Initial FastAPI application

This commit is contained in:
m1000 committed 2026-11-13 02:27:15 +03:00
1 parent a34e861612
commit b118e1d539
6 files changed
+98

No files matched your search

View File
Whitespace-only changes.
+26
View File
@@ -0,0 +1,26 @@
from fastapi import FastAPI
app = FastAPI(
title="FastAPI Demo",
description="My first application with FastAPI",
version="1.0.0",
)
@app.get("/")
async def root():
return {
"message": "Hello from FastAPI!",
"application": "fastapi-demo",
"version": "1.0.0",
}
@app.get("/health")
async def health():
return {"status": "ok"}
@app.get("/hello/{name}")
async def hello(name: str):
return {"message": f"Hello, {name}!"}