Skip to content
Snippets Groups Projects
Commit 5de26a72 authored by Christopher Feldhues's avatar Christopher Feldhues :call_me_tone1:
Browse files

weiter

parent a2e9c551
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,20 @@ from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"greeting":"Hallo MSA!"}
counter = {"count": 0}
@app.post("/increment")
def increment_counter():
counter["count"] += 1
return {"message": "Counter incremented", "count": counter["count"]}
@app.get("/count")
def get_counter():
return {"count": counter["count"]}
@app.delete("/reset")
def reset_counter():
counter["count"] = 0
return {"message": "Counter reset", "count": counter["count"]}
# uvicorn main:app --reload
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment