Closed NamesMT closed 6 months ago
Some possible solutions:
.route()
grouping for specific routes/methods.eventSource
, we could then provide a helper function to loop through the top-level app.router.routes
and just return the string after the last "/" on TRIGGER
method, we only need to run it once.route()
them without a prefix, this increases the instances and export/import count.Solved in e834b15
Trigger event routes/paths support works as a simple wrapper that gets the
eventSource
, and transforms it intomethod:TRIGGER path:eventSource
Request for Hono to process, we would then register routes onTRIGGER
method.For it to work perfectly, the paths of the
eventSource
should never intended to be prefixed, i.e:TRIGGER
method should never be prefixedCurrently Hono doesn't provide any (and I can't find hack-able) way to get or skip the prefix of
.route()
grouping, so, Hono instances with trigger events would break after getting grouped with.route()