added fastapi to requirements. First step to replace flask with fastapi

This commit is contained in:
2026-02-27 20:43:38 +01:00
parent 2f308584c0
commit 45397c069c
3 changed files with 32 additions and 1 deletions

View File

@@ -1,3 +1,19 @@
Internes Tool zur Kalkulation von Blechteilen. Internes Tool zur Kalkulation von Blechteilen.
Derzeit keine Unterstützung von Baugruppen! Derzeit keine Unterstützung von Baugruppen!
Zur Installation:
1. venv erzeugen
2. . .venv/bin/activate
3. pip install -r requirements
Web server mit fastapi starten:
uvicorn main:app --host 0.0.0.0 --port 8001 --reload
mit folgender URL im Browser ist der Einstiegpunkt:
http://127.0.0.1:8001/

14
main.py Normal file
View File

@@ -0,0 +1,14 @@
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str | None = None):
return {"item_id": item_id, "q": q}

View File

@@ -2,3 +2,4 @@ flask==3.0.3
gunicorn==22.0.0 gunicorn==22.0.0
ezdxf==1.3.4 ezdxf==1.3.4
pillow==10.4.0 pillow==10.4.0
fastapi[standard]==0.133.1