add app execution in main, so users dont have to rely on fastapi being in path
parent
3b8c48f5cf
commit
7bc1345d60
|
|
@ -53,3 +53,6 @@ async def ui(request: Request):
|
|||
{"id": 2, "name": "Product 2", "price": 20.0}
|
||||
]
|
||||
return templates.TemplateResponse("products.html", {"request": request, "products": products})
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(app, host="127.0.0.1", port=8000)
|
||||
|
|
|
|||
Loading…
Reference in New Issue