mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
20 lines
339 B
TypeScript
20 lines
339 B
TypeScript
import { Hono } from "hono";
|
|
|
|
type Variables = {
|
|
message: string;
|
|
};
|
|
|
|
const app = new Hono<{ Variables: Variables }>();
|
|
|
|
app.use(async (c, next) => {
|
|
c.set("message", "Hono is cool!");
|
|
await next();
|
|
});
|
|
|
|
app.get("/", c => {
|
|
const message = c.get("message");
|
|
return c.text(`The message is "${message}"`);
|
|
});
|
|
|
|
export default app;
|