Mosh Ontong
Mosh Ontong
HHono
Created by Mosh Ontong on 2/18/2025 in #help
How to pipe the archive in stream hono?
const streamPipe = new PassThrough();
archive.pipe(streamPipe);

const write = new WritableStream();


return stream(
c,
async (stream) => {
streamPipe.pipe(stream);
},
async (err, stream) => {
stream.writeln("An error occurred while streaming the file.");
logger.error(err);
}
);
const streamPipe = new PassThrough();
archive.pipe(streamPipe);

const write = new WritableStream();


return stream(
c,
async (stream) => {
streamPipe.pipe(stream);
},
async (err, stream) => {
stream.writeln("An error occurred while streaming the file.");
logger.error(err);
}
);
17 replies
HHono
Created by Mosh Ontong on 2/18/2025 in #help
Hono React with bun
Error:
Type '(props: Props) => boolean' is not assignable to type 'FC'.
Type 'boolean' is not assignable to type 'HtmlEscapedString | Promise<HtmlEscapedString> | null'.ts(2322)
const Layout: FC
Type '(props: Props) => boolean' is not assignable to type 'FC'.
Type 'boolean' is not assignable to type 'HtmlEscapedString | Promise<HtmlEscapedString> | null'.ts(2322)
const Layout: FC
Code:
import { Hono } from "hono";
import { serveStatic } from "hono/bun";
import type { FC } from "hono/jsx";

const app = new Hono();

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

app.get("/", (c) => c.text("Hello Bun!"));

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

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: "./",
})
);

app.get("/", (c) => c.text("Hello Bun!"));

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

export default app;
13 replies
HHono
Created by Mosh Ontong on 1/24/2025 in #help
How can I stream a video in hono?
I want also to put a range header when user wants to put a specific time of video
1 replies
HHono
Created by Mosh Ontong on 10/24/2024 in #help
Hono websocket with bun typescript issue
1 replies