-
Is there a way to group all routes and pass it as a generic type to For example: const app = new Hono<{Variables: Variables}>().basePath('/api')
const posts = app.route('/posts', post)
const auth = app.route('/auth', authRoutes) |
Beta Was this translation helpful? Give feedback.
Answered by
itsdillon
Nov 6, 2023
Replies: 1 comment 4 replies
-
It that case, you can use a Union. type AppType = typeof posts | typeof auth |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok just figured out the issue. Maybe this will help someone else if they come across it @yusukebe.
Before I was doing:
What fixed it, was chaining and exporting post like how you have it:
Not sure if this is intentional or not.