generated from hjess/PythonTemplateProject
added middelware
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Has been cancelled
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Has been cancelled
This commit is contained in:
13
app.py
13
app.py
@@ -1,3 +1,4 @@
|
||||
import uvicorn
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.responses import HTMLResponse
|
||||
@@ -53,4 +54,14 @@ async def get_category(request: Request, category_name: str):
|
||||
"content": category_content
|
||||
},
|
||||
)
|
||||
return HTMLResponse("Kategori ikke fundet", status_code=404)
|
||||
return HTMLResponse("Kategori ikke fundet", status_code=404)
|
||||
|
||||
# Main entry point
|
||||
def main():
|
||||
"""Run the FastAPI app directly"""
|
||||
uvicorn.run("app:app", host="0.0.0.0", port=8000, reload=True, proxy_headers=True)
|
||||
|
||||
|
||||
# Run main when executed directly
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user