From 7399cbe785fd4d852fa67e54d56887322588f7c6 Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Sun, 11 Jan 2026 14:57:51 -0600 Subject: [PATCH] Add / template --- express/basic/routes.ts | 9 ++++++++- templates/basic/home.html.njk | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 templates/basic/home.html.njk diff --git a/express/basic/routes.ts b/express/basic/routes.ts index fc01d60..4c207fc 100644 --- a/express/basic/routes.ts +++ b/express/basic/routes.ts @@ -3,6 +3,9 @@ import type { Call, Result, Route } from "../types"; import { html, render } from "../util"; import { loginRoute } from "./login"; +import { services } from '../services'; + + const routes: Record = { hello: { path: "/hello", @@ -18,7 +21,11 @@ const routes: Record = { path:'/', methods:['GET'], handler:async(_call:Call): Promise => { - const c = await render('basic/home') + const auth = services.auth + const me = services.session.getUser() + + const email = me.toString() + const c = await render('basic/home',{email}) return html(c) } diff --git a/templates/basic/home.html.njk b/templates/basic/home.html.njk new file mode 100644 index 0000000..3dd682d --- /dev/null +++ b/templates/basic/home.html.njk @@ -0,0 +1,11 @@ + + + +

+ home +

+

+ {{ email }} +

+ +