codeauthor
codeauthor
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
I wanted to group related endpoints. And have a separate file for route handling
22 replies
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
This is great.... This is the endpoints chaining I was talking about. I wanted something more like node and Express.
22 replies
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
Oh... Sadly Hono doesn't have a built in createRoute API.
22 replies
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
This explains it. I guess I have to swap to zod openapi. Thank you
22 replies
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
Okay. Thank you
22 replies
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
Wow, that's incredible! How did you pull that off? I'd love to learn more about your process.
22 replies
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
It's difficult to say. The auto complete feature works better when you're chaining the endpoints, which is also the recommended way. But I wanted to break it into separate files using the createfactory API according to the docs. But the createfactory API is not smart enough to infer the types.
22 replies
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
No, it didn't fix it. I passed the route definition when initializing Hono.
type RouteSchema = {} // define the path to endpoint here

const app = new Hono<{}, RouteSchema, "/">()
type RouteSchema = {} // define the path to endpoint here

const app = new Hono<{}, RouteSchema, "/">()
22 replies
HHono
Created by codeauthor on 9/24/2024 in #help
Hono RPC
Hey Coleretriever, I finally figured out why I wasn't getting auto-complete in my Hobo RPC project. It turns out that breaking the app into modules was causing the issue. I tried using the createFactory method as suggested in the docs, but it wasn't working. Luckily, I was able to resolve it by manually defining the types.
22 replies