1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-01-31 06:18:07 +00:00
_/hono/main.ts

29 lines
499 B
TypeScript
Raw Normal View History

2024-03-10 00:18:12 +09:00
import { serve } from "@hono/node-server";
import { Hono } from "hono";
import { html } from "hono/html";
import { showRoutes } from "hono/dev";
import { Foo } from "./foo";
const app = new Hono();
const Html = html`<!DOCTYPE html>
<html>
<head>
<title>Hello</title>
</head>
<body>
${Foo({
messages: ["bar", "baz"],
})}
</body>
</html>`;
app.get("/", (c) => {
return c.html(Html);
});
const port = 3000;
serve({ ...app, port });
showRoutes(app);