aboutsummaryrefslogtreecommitdiff
path: root/kennel/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'kennel/main.py')
-rw-r--r--kennel/main.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/kennel/main.py b/kennel/main.py
index f0eaaca..3cca2c0 100644
--- a/kennel/main.py
+++ b/kennel/main.py
@@ -2,6 +2,8 @@ import uuid
import structlog
from fastapi import FastAPI, Request, Response
+from fastapi.staticfiles import StaticFiles
+from fastapi.templating import Jinja2Templates
app = FastAPI()
logger = structlog.get_logger()
@@ -33,6 +35,8 @@ async def logger_middleware(request: Request, call_next):
return response
+templates = Jinja2Templates(directory="templates")
+
@app.get("/healthcheck")
async def healthcheck():
@@ -40,6 +44,10 @@ async def healthcheck():
@app.get("/")
-async def read_main():
- logger.info("In root path")
- return {"msg": "Hello World"}
+async def read_main(request: Request):
+ return templates.TemplateResponse(
+ request=request, name="index.html"
+ )
+
+app.mount("/static", StaticFiles(directory = "static"), name = "static")
+