added fastapi to requirements. First step to replace flask with fastapi
This commit is contained in:
16
README.md
16
README.md
@@ -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
14
main.py
Normal 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}
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user