Ayoub
Ayoub
HHono
Created by Ayoub on 2/9/2025 in #help
Extract routes from hono definition
Hi everyone, i want to extract all the routes from hono definition for example :
export const app = new Hono<Env>()
.route('/transactions', transactionsRoute);
export const app = new Hono<Env>()
.route('/transactions', transactionsRoute);
How is it possible ?
I want to make a function that take a typesafe parameter that will be the route
const fn = (route: AnyPossibleRoute) => {}
const fn = (route: AnyPossibleRoute) => {}
and when i call the function fn, there will be autocompletion and i can have these possible options : /api/transactions /api/transactions/all /api/transactions/:id etc ... I'm fighting with ExtractSchema utility type but I don't achive my goal Thanks.
8 replies