From ac8a0c259a5d4dbba4b130218a7cc3fbe9fe21b5 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Wed, 28 Jan 2026 11:08:09 -0800 Subject: [PATCH] log truisms --- apps/truisms/index.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/truisms/index.ts b/apps/truisms/index.ts index 0d5de4d..87794a5 100644 --- a/apps/truisms/index.ts +++ b/apps/truisms/index.ts @@ -4,8 +4,13 @@ const app = new Hono() const html = (strings: TemplateStringsArray, ...values: any[]) => strings.reduce((result, str, i) => result + str + (values[i] || ''), '') +const truism = (): string => { + const text = TRUISMS[Math.floor(Math.random() * TRUISMS.length)]! + console.log(text) + return text +} + app.get("/", (c) => { - const truism = TRUISMS[Math.floor(Math.random() * TRUISMS.length)] return c.html(html` @@ -33,13 +38,13 @@ app.get("/", (c) => { -

${truism}

+

${truism()}

`) }) -app.get("/txt", (c) => c.text(TRUISMS[Math.floor(Math.random() * TRUISMS.length)]!)) +app.get("/txt", c => c.text(truism())) export default { port: process.env.PORT || 3000,