Mosh Ontong
Mosh Ontong
HHono
Created by Mosh Ontong on 2/18/2025 in #help
Hono React with bun
do I need to put into a tsx file?
13 replies
HHono
Created by Mosh Ontong on 2/18/2025 in #help
Hono React with bun
import { Hono } from "hono";
import { serveStatic } from "hono/bun";
import type { FC } from "hono/jsx";

const app = new Hono();

app.use(
"/static/*",
serveStatic({
root: "./",
})
);

const Layout: FC = (props) => {
return (
<html>
<body>{props.children}</body>
</html>
);
};

const Top: FC<{ messages: string[] }> = (props: { messages: string[] }) => {
return (
<Layout>
<h1>Hello Hono!</h1>
<ul>
{props.messages.map((message) => {
return <li>{message}!!</li>;
})}
</ul>
</Layout>
);
};

app.get("/", (c) => {
const messages = ["Good Morning", "Good Evening", "Good Night"];
return c.html(<Top messages={messages} />);
});

export default app;
import { Hono } from "hono";
import { serveStatic } from "hono/bun";
import type { FC } from "hono/jsx";

const app = new Hono();

app.use(
"/static/*",
serveStatic({
root: "./",
})
);

const Layout: FC = (props) => {
return (
<html>
<body>{props.children}</body>
</html>
);
};

const Top: FC<{ messages: string[] }> = (props: { messages: string[] }) => {
return (
<Layout>
<h1>Hello Hono!</h1>
<ul>
{props.messages.map((message) => {
return <li>{message}!!</li>;
})}
</ul>
</Layout>
);
};

app.get("/", (c) => {
const messages = ["Good Morning", "Good Evening", "Good Night"];
return c.html(<Top messages={messages} />);
});

export default app;
13 replies
HHono
Created by Mosh Ontong on 2/18/2025 in #help
How to pipe the archive in stream hono?
Is there another way to use the archive in hono?
17 replies
HHono
Created by Mosh Ontong on 2/18/2025 in #help
How to pipe the archive in stream hono?
17 replies
HHono
Created by Mosh Ontong on 2/18/2025 in #help
How to pipe the archive in stream hono?
I already higlight with js
17 replies
HHono
Created by Mosh Ontong on 2/18/2025 in #help
How to pipe the archive in stream hono?
node
17 replies
HHono
Created by Mosh Ontong on 2/18/2025 in #help
How to pipe the archive in stream hono?
By the way I am using bun with hono
17 replies
HHono
Created by Mosh Ontong on 2/18/2025 in #help
How to pipe the archive in stream hono?
Error: Argument of type 'StreamingApi' is not assignable to parameter of type 'WritableStream'. Type 'StreamingApi' is missing the following properties from type 'WritableStream': writable, end, addListener, on, and 13 more.ts(2345) (parameter) stream: StreamingApi
17 replies