Hono

H

Hono

This is the official Hono discord server for the community

Join

StreamSSE on http2

Hi ! It seems that the streamSSE feature is not correctly adapted to work on http2. It adds the following header ‘transfer-encoding’->‘chuncked’, which is not authorised on http2. ```js var streamSSE = (c, cb, onError) => { const { readable, writable } = new TransformStream(); const stream = new SSEStreamingApi(writable, readable);...

Optional params in hono/client

It seems that it doesn't support optional params at all. In hono I can specify optional parameters, but in hono/client this is not supported. If I have a route with /:idOrSlug?/invite, then it will match /invite and /:idOrSlug/invite. And if I insert the correct value for the hono client then everything will work, but if it is undefined it will just put the undefined value in the url as shown in the screenshot above....
No description

Send data to Hono

Hi, how can i send Request body and file on same route.

Client ip

How can I get the client ip, I need it for my rate limiter

What is the best way to handle the error?

What I want is to get the error from server to client using rpc + react query 1. Using trycatch 2. Returning c.json({ message: 'Invalid password' }, 401) 3. Throwing HTTPException(401, { message: 'Invalid password' })...
No description

Running `bun run dev` on a newly created Cloudflare Pages example spits an error

``` bun run dev $ vite (!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling. error when starting dev server:...

connect my hono application endpoints with swagger ui

how i can use swagger ui with my hono application

How to set "credentials: true" in client side using rpc?

I'm using rpc with react query on the client side, this kind of fetching has already credentials: true?
No description

Cookies doesn't process

When I try to run in my middleware the following ``` setCookie(c, 'test', 'res', { maxAge: 60 * 60 * 24 * 7, httpOnly: true }) console.log(getCookie(c, 'test'));...

use Context to get vars from wrangler.toml

how can fix this code. i want to use my openaiApiKey from the wrangler.toml when i create an openai instance. but i cannot use the context . how can i fix it ?
No description

Connect Hono Cloudflare with MongoDB

Hi. I am using Hono and deploying to Cloudflare. However I am unable to find a way to connect mongodb database using mongoose

Case insensitive query params

We are using hono-zod-openapi to replace an existing API. Sadly the old API (written in ASP.Net) appears to have case-insensitive handling of parameters - and we may need to emulate this. Gah. So we have something like ```...

Password hashing

How to hash password?

How to setup Hono with Remix/Cloudflare for Vite dev server?

From the documentation for Cloudflare Pages, there is an adapter and a plugin, but it is not clear how we can configure both Hono and Remix to run on the Vite dev server. ```ts import devServer from '@hono/vite-dev-server' import adapter from '@hono/vite-dev-server/cloudflare' import build from '@hono/vite-cloudflare-pages'...

Validate response objects

Using the zod validator middleware it is possible to validate params , query, request body like: ``` const route = app.post(...

Hono Oauth Provider with JWT issue

Hey everyone! I'm not sure if this is the right place for me to post about this but recently I wanted to try to use Hono and also saw there was a package for it @hoino/oauth-providers which I also wanted to try. Now I noticed that in my main login.ts route where I use hono/jwt package then I'm getting errors inside my google.ts file where I use the googleAuth from @hono/oauth-providers/google. Currently I'm still using the basic stuff to figure out how things work and how I can use it so don't mind that. This is my /routes/auth/login.ts file...
No description

Deploy Hono / Bun API

I know, I know this is such a newby question but I come from small express apps and other simple ‘click to deploy’ frameworks. I recently discovered Hono and more recently tried to build the app out on Bun because the built in web sockets are amazing. I am just at a loss how to deploy the small API I built. Any insights / examples of how one might deploy a simple API with Hono/Bun would be amazing. I feel like Docker is my best bet but am still not a master with it. Should add, I would appreciate any docs or articles that might help as well. Just excited to push this thing and test it out on a production server. Thanks to all who take the time to read! Best wishes!...

Is there a way to list all request headers ?

I have this use case where I am not sure which header key is being sent, I would like to log all headers to understand more about it.

Typing Middleware JWT and others

Currently I am trying to type the c.get('jwtPayload') that is documented here. I have tried using the method described here in a global.d.ts file but this does not seem to take any affect, the jwtPayload get result is still typed as any. Currently I have removed the global.d.ts file and set types on the Hono instance instead so its more explicit. This is still not working for the jwtPayload (and other values I use in middelware like the oauth middleware): ```typescript...

How to generate openapi.yaml spec with Zod OpenAPI Hono?

Is it possible to generate the openapi.yaml spec with Zod OpenAPI Hono from the commandline using a npm command? I need this in my development workflow to use the openapi.yaml to generate some other client code from the spec....