export const orgAndWebsiteMiddleware = async (c, next) => { const { user, token } = c.var; const referrer = c.req.header('referer'); const referrerUrl = referrer && new URL(c.req.header('referer')); const org = c.req.query('org') || referrerUrl?.searchParams.get('org'); const ws = c.req.query('ws') || referrerUrl?.searchParams.get('ws'); ...}
app.get('/', (c) => { const posted = getCookie(c, 'posted'); if (posted) return c.html(<h1>Posted</h1>); return c.html( <form method="POST"> <button type="submit">Submit</button> </form>, );});app.post('/', (c) => { setCookie(c, 'posted', 'true'); return c.redirect('/');});
app.post('/', (c) => { return c.redirect('/');});
import { Hono } from 'hono';const { ADMIN_PORT: PORT } = process.env;const app = new Hono();Bun.serve({ port: PORT, reload: true, fetch: app.fetch,});app.get('/', (c) => { return c.html( <form method="POST"> <button type="submit">Submit</button> </form>, );});app.post('/', (c) => { return c.html(<h1>POSTED</h1>);});console.log('Admin app running on port', PORT);