diff --git a/keycloak_collective_portal.py b/keycloak_collective_portal.py index 685222b..6998653 100644 --- a/keycloak_collective_portal.py +++ b/keycloak_collective_portal.py @@ -1,10 +1,15 @@ """Community Keycloak SSO user management.""" -from fastapi import FastAPI +from fastapi import FastAPI, Request +from fastapi.responses import HTMLResponse +from fastapi.templating import Jinja2Templates app = FastAPI() +templates = Jinja2Templates(directory="templates") -@app.get("/") -def read_root(): - return {"Hello": "World"} +@app.get("/", response_class=HTMLResponse) +async def home(request: Request): + return templates.TemplateResponse( + "index.html", context={"request": request} + ) diff --git a/styles.css b/styles.css new file mode 100644 index 0000000..70b786d --- /dev/null +++ b/styles.css @@ -0,0 +1 @@ +// TODO diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..9891071 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,8 @@ + + + Home + + +

Hello, World

+ +