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 }} +

+ +