Aditya Mathur
Aditya Mathur
HHono
Created by Enyel on 10/21/2024 in #help
Infer client openAPI
Hey there are some know issues with the @hono/zod-openapi, this might be one of those. I have created a middleware which helps with generating the OpenAPI Specs in your normal hono app, you can try that. https://github.com/rhinobase/hono-openapi
2 replies
HHono
Created by marcbejar on 10/19/2024 in #help
Git Autodeploy on Cloudflare
Seems like the issue could be related to how you have connected your GitHub Repo. I would suggest to ask this in the Cloudflare discord as those might be able to help you better regarding this.
3 replies
HHono
Created by mihaaai on 10/16/2024 in #help
Is there a way to get bindings outside the `c` Context of an inbound Request in Cloudflare Workers?
Then I think you should either ask them in their discord or create a discussion/issue on their GitHub regarding this.
10 replies
HHono
Created by mihaaai on 10/16/2024 in #help
Is there a way to get bindings outside the `c` Context of an inbound Request in Cloudflare Workers?
Yeah, this is perfect - https://www.better-auth.com/docs/integrations/hono#mount-the-handler, just init the auth inside the function. honestly regarding the function if you are not running this on node then you are still init the auth on each request. If you are on node then you can just store the auth instance as a global variables once init.
10 replies
HHono
Created by mihaaai on 10/16/2024 in #help
Is there a way to get bindings outside the `c` Context of an inbound Request in Cloudflare Workers?
Like this Hono<{ Variables: { auth: any } }>()
10 replies
HHono
Created by mihaaai on 10/16/2024 in #help
Is there a way to get bindings outside the `c` Context of an inbound Request in Cloudflare Workers?
But you will setting the value inside a middleware, so you will have access to the bindings. Rough Example -
app.use(async (c, next) => {
const auth = betterAuth({
// ...
database: c.env.DB
})

c.set("auth", auth)
})
app.use(async (c, next) => {
const auth = betterAuth({
// ...
database: c.env.DB
})

c.set("auth", auth)
})
. Dont forget to add auth in hono variables
10 replies
HHono
Created by DJ on 10/17/2024 in #help
Is there any way to mock cookies using testing helpers?
Usually the behavior is that we get connect to a test env where their is mock user, which we use to get the cookie.
6 replies
HHono
Created by DJ on 10/17/2024 in #help
Is there any way to mock cookies using testing helpers?
What is Cookie? and how are you adding cookies in your frontend?
6 replies
HHono
Created by mihaaai on 10/16/2024 in #help
Is there a way to get bindings outside the `c` Context of an inbound Request in Cloudflare Workers?
Why don't you store the auth instance in the context by .set() using a middleware? That why you will also get the context object as well as a single instance will be used across your request
10 replies
HHono
Created by avem on 10/14/2024 in #help
Pass context to exception handler
You can pass this data in the Exception as well as set this in context using .set and access it in the onError using .get
4 replies
HHono
Created by -purchasable- on 10/11/2024 in #help
hono type definition not working (using hono first time)
2 replies
HHono
Created by anand248 on 10/9/2024 in #help
honox - not returning anything from POST, gives 404.
I think this also happens in hono
3 replies
HHono
Created by Peтe on 10/9/2024 in #help
JSX not working at all with just "bun add hono"
@Peтe are you using any middleware here?
14 replies
HHono
Created by Peтe on 10/9/2024 in #help
JSX not working at all with just "bun add hono"
Hey @Shy based upon this https://discord.com/channels/1011308539819597844/1012485912409690122/1293495908193013845, it seems this code is working. My guess is either their is some middleware which is effecting this or the bun runtime.
14 replies
HHono
Created by h on 9/3/2024 in #help
Argument type string is not assignable to parameter type keyof E["Variables"]
Can you show the code snippet?
8 replies
HHono
Created by anand248 on 10/7/2024 in #help
Using honox, bun, vite and using islands folder, Hot Reload doesn't work
Honox is still experimental and still not ready for production bu you can create an issue in the honox repo regarding this
2 replies
HHono
Created by h on 9/3/2024 in #help
Argument type string is not assignable to parameter type keyof E["Variables"]
No description
8 replies
HHono
Created by h on 9/3/2024 in #help
Argument type string is not assignable to parameter type keyof E["Variables"]
Seems to be working on VSCode -
export const getUserField = (
context: Context<{ Variables: { user: string } }>
) => {
const user = context.get("user");
};
export const getUserField = (
context: Context<{ Variables: { user: string } }>
) => {
const user = context.get("user");
};
8 replies
HHono
Created by 0x146231489231923 on 9/16/2024 in #help
where do u host hono?
VPS/Containers (nodejs) and Cloudflare
7 replies
HHono
Created by Steven-sensei on 9/16/2024 in #help
Integration testing with test client and HTTP only cookies
I think if you are getting it from the server you can check the response for the Set-Cookie header to get the cookie
6 replies