WIP! A BB-style forum, on the ATmosphere!
We're still working... we'll be back soon when we have something to show off!
node
typescript
hono
htmx
atproto
1import { Hono } from "hono";
2import { BaseLayout } from "../layouts/base.js";
3import { getSession } from "../lib/session.js";
4import { FALLBACK_THEME, type WebAppEnv } from "../lib/theme-resolution.js";
5
6export function createNotFoundRoute(appviewUrl?: string) {
7 return new Hono<WebAppEnv>().all("*", async (c) => {
8 const resolvedTheme = c.get("theme") ?? FALLBACK_THEME;
9 const auth = appviewUrl
10 ? await getSession(appviewUrl, c.req.header("cookie"))
11 : { authenticated: false as const };
12 return c.html(
13 <BaseLayout title="Page Not Found — atBB Forum" auth={auth} resolvedTheme={resolvedTheme}>
14 <div class="error-page">
15 <div class="error-page__code">404</div>
16 <h1 class="error-page__title">Page Not Found</h1>
17 <p class="error-page__message">
18 This page doesn't exist or has been removed.
19 </p>
20 <a href="/" class="btn btn-primary">Back to Home</a>
21 </div>
22 </BaseLayout>,
23 404
24 );
25 });
26}