Has anyone got Hono with Convex working
Has anyone got Hono with Convex working? Trying to follow this article: https://stack.convex.dev/hono-with-convex but running into errors:
The above line of the lookup method seems broken -
match
doesnt have a property handlers
.
Is there another way of adding dynamic / wildard routes to convex? I.e. URLs of the form /user/:id2 Replies
Looks like this needs to be updated to work with newer versions of hono. I'll work on updating our examples.
I think the fix is something like
But also this method is mostly doing some work to make the requests show up nicely in Convex dashboard logs.
Changing
lookup
to just return [this._handler, normalizeMethod(method), path] as const;
will work, but the dashboard will show stuff like GET /users/123
instead of GET /users/:userId
Thanks for getting back to me. Your fix worked.
I thought it wasn't for a second because I was getting a 404 when hitting the endpoint. It turns out that was because I wasn't returning anything from my request handler.
Not sure who is responsible for the 404 (convex or hono), but better messaging around that would have been nice.
Anyway, thanks again!