Hono

H

Hono

This is the official Hono discord server for the community

Join

Help with REGEX doesnt work on route path definition

I have this route definition: ``` app.on(["POST", "GET"], "/api/auth/**", (c) => { return auth.handler(c.req.raw);...

Configuring Storybook with Hono

Hey, I am trying to configure storybook with Hono, is there an easy way of doing this? Thanks!...

TSX layout / templating question

- is there a way to link a static style sheet from the server side tsx components?? i've been trying, searching and proompting, what am i missing... - im using server side tsx to render html and i want to link a style sheet instead of using the jsx css helper, can i just link a stylesheet like normally? main.tsx...

relative pathname in Request not working on POST request

Using the pathname in a GET request everything works fine. Code: ```js test("GET: all car brands", async () => { const res = await app.request("/api/brand");...

What is the difference between `Zod OpenAPI` and `Hono OpenAPI`?

From reading the docs I can't tell why I should use one as opposed to the other. Can I use both? If so, how?

Can't get the RPC typing

Hey ! Hope you're doing well, I have an issue with the RPC types, how can I manage to get the client types ? ```ts // hc.ts import router from "./root";...

Image uploaded to S3 cannot be displayed when run on Lambda

I'm trying to upload images to S3 via AWS Lambda using Hono, but when I open the image url it shows The image cannot be displayed because it contains error My Setup: - Frontend: SvelteKit, sending a multipart/form-data request with the image. - Backend: AWS Lambda with Hono ...

HonoX change entry file

In the new HonoX, how can I change the entry file from app/server.ts to src/server.ts? there is an entry option in the honox vite plugin but that doesn't work

No Types for RPC with abstracted routes

I'm not getting any type hints from my Hono RPC client. I know there are warnings not to use the factory method, but as far as I knew this was the only way to have abstracted routes, which I find pretty important for organizing many routes. ```ts type Env = { Variables: {...

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?
Next