1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/** @jsxImportSource npm:hono/jsx **/
import { Hono } from "npm:hono";
import type { FC } from "npm:hono/jsx";
const Layout: FC = (props) => {
return (
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.12.10/dist/full.min.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>{props.children}</body>
</html>
);
};
const Main: FC<{ data: Record<string, any> }> = (props) => {
return (
<Layout>
<main class="container">
<div className="mockup-browser bg-base-300 border">
<div className="mockup-browser-toolbar">
<div className="input">https://daisyui.com</div>
</div>
<div className="bg-base-200 flex justify-center px-4 py-16">{props.data.title}</div>
</div>
</main>
</Layout>
);
};
const app = new Hono();
app.get("/", (c) => {
const data = {
title: "Hello Hono!",
};
return c.html(<Main data={data} />);
});
export default app.fetch;