Files
diachron/express/basic/routes.ts

19 lines
462 B
TypeScript

import { DateTime } from "ts-luxon";
import type { Call, Result, Route } from "../types";
import { html, render } from "../util";
const routes: Record<string, Route> = {
hello: {
path: "/hello",
methods: ["GET"],
handler: async (call: Call): Promise<Result> => {
const now = DateTime.now();
const c = await render("basic/hello", { now });
return html(c);
},
},
};
export { routes };