Hono

H

Hono

This is the official Hono discord server for the community

Join

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

Get `auth` session when API endpoint is called from a server component

```ts import { Hono } from 'hono' import { verifyAuth } from '@hono/auth-js' import { zValidator } from '@hono/zod-validator' import { db } from '@/db'...

How can I use hono/jsx templates to send Emails via Nodemailer?

I'm not sure if this is possible currently... I would like to render a JSX or TSX component without having to set up a route. I want to render a JSX component to an html string with one function call, so I can pass the string to nodemailer. How can I achieve this with hono?...

Is there a simple way to bundle the directory served by serveStatic into a single file executable?

So, I'm not 100% sure if I should be asking this here or on bun support, as it may be more of a bun issue, but I figured that you guys would be the most likely to need to do this. I've tried the recommendation from the bun documentation to embed directories (https://bun.sh/docs/bundler/executables#embed-directories) but this gives me an error about not being able to find an entrypoint there. So far I've only been able to include my static files by manually adding them to the directory containing the executable, but I'm very interested in the alleged ability of bun to include all the files inside the executable....

Loading routes from Cloudflare KV?

I need to store routes in a dynamic fashion (be it env or KV) since routes will controlled from a third party -- is there a way to load these without adding a "default" catchall route that then has access to env/kv context from where the routes can be loaded? Optimally I can avoid a route.all(...) that has the logic to fetch this and then add additional routes.

How to test / develop AWS Lambda locally?

I created a new AWS Lambda project with Hono. But with the Node.js template I can test my endpoints locally. This is not the case with the AWS Lambda template... Is there a way to still develop and test locally with this template? https://hono.dev/docs/getting-started/aws-lambda...

Problem passing jwt token by rpc

hi guys, i have an endpoint localhost:5555/api/summary, that works fine testing on any app like postman, passing an Bearer token, but do not work when i use hono client passing the bearer token, always says that the token is not passed ```js const app = new Hono().get("/", async (c) => {...

Hono RPC issue with .use

When I use Hono Rpc it only works if I remove .use
No description

How to make Hono Cloudflare server run on network public ip so that other devices can also access it

Usually, Hono works on localhost, which is good. But I am testing my app on mobile but localhost does not work on mobile. it works on network IP addresses like 192.168.1.68. How can I enable it for this IP address?...

Question on vite build with node server

Hey, I'm new to using hono and I was trying to make a production build with vite using the vite-build plugin but whenever I run it none of the env variables will load. For dev I was injecting them with the dotenv-cli within the package.json scripts, but no matter what I do I cannot get them to work after making a vite build. after the build i'm using the node "./dist/index.js" command but when logging the process.env variable there is nothing in there when compared to dev. I'm going to test out trying to deploy this today with wrangler/cloudflare but I was just experimenting and trying to get the build to run locally for testing but nothing was working....

maxAge parameter in Hono Cookie Helper takes seconds?

I have a problem, I have a problem that seems to be solved, but to make sure I wanna ask if maxAge parameter in Hono Cookie Helper expects seconds and not milliseconds as in express cookie-parser?

Can't integrate hono with tus server

Anyone here used Tus: @tus/server I'm having difficulty using hono with it. Here are the different examples of using it with other providers: https://github.com/tus/tus-node-server/tree/main/packages/server#example-integrate-tus-into-express here is what I tried:...

Error cannot file module "@hono/bun" (TS2307)

I'm trying to statically serve some files, in the docs it says to use serveStatic from @hono/bun, but I receive the error modules and its types not found. I've tried multiple solutions but none work: - Tried installing the packaged to ensure @hono/bun was installed using bun add @hono/bun (but it doesnt even exist)...

Best way to export types for use in a separate app with `hc` client

I have a monorepo where one folder contains the Hono app, and another a SvelteKit one. How best do I make the type available to the SvelteKit project for use with the hc client?

Confused by recommendation to compile Hono App and Client

My question is specifically regarding this section of the documentation https://hono.dev/docs/guides/rpc#compile-your-code-before-using-it-recommended I want to compile the types for my Hono client to take some of the workload off TSServer and utilise TSC, and because the VSCode extension for SvelteKit is incorrectly typing the responses returned from the client. I have set up a Deno task and a tsconfig to run tsc on this code: ```ts...

Type safety in middleware?

Hi, it's there a way to get the types right here? ```typescript import { Hono } from "hono" import { hc } from "hono/client" ...

OpenTelemetry?

Hi, does anyone know how to easily implement OpenTelemetry with Hono? Without creating spans manually

What's the recommended way of doing auth?

I'm doing a simple app, just to save my local snippets for now, but it will become a product, so I'll need authentication. The hono server rn is sending html (not an api). There doesn't seem to be a good/simple solution for that in the docs, so what library is recommended for doing auth?...

What can Hono’s web socket helper do that Deno.upgradeWebSocket can’t?

Can someone explain the purpose of using the Hono WebSocket adapter? I'm working with Deno, and since Hono is an HTTP server and Deno has Deno.upgradeWebSocket, it seems like there's not much need for Hono's adapter. WebSocket messages don't go over HTTP, so there's no routing involved anyway. Am I missing something? 🤔