How to separate code into files for each handler without loosing the hono RPC typesafety?
I have an auth route , which i separated into its own file. But each route with method and handler are chained in one file and it already has 400+ lines of code. When trying to separate it into files and chain them all in index.ts with route(), RPC start to loose typesafety. Can someone share some patterns on how to do something like this ?
1 Reply
I'm doing exactly the same thing. I don't really care if the single auth routes file is going over 400+ lines of code,
If you still want to separate out the routes within the auth "module", you could:
Disclaimer I haven't actually tested if it works, but that seems to be the most logical way in my head. LMK if it actually worked.