You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trigger event routes/paths support works as a simple wrapper that gets the eventSource, and transforms it into method:TRIGGER path:eventSource Request for Hono to process, we would then register routes on TRIGGER method.
For it to work perfectly, the paths of the eventSource should never intended to be prefixed, i.e: TRIGGER method should never be prefixed
Currently 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()
The text was updated successfully, but these errors were encountered:
Solution 1: update to Hono's core, providing some way to get/skip the prefix of .route() grouping for specific routes/methods.
Solution 2: Agree to never use path delimiter "/" in 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.
Solution 3: A helper function that receives both the top-level app instance and the instance that contains the trigger event routes, would automatically detect and remove the prefixed path, we need to pass in all instances that registered the trigger event routes, also a bit high count of loops and search.
Solution 4: Register the trigger event routes in a separate instance and route() them without a prefix, this increases the instances and export/import count.
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()
The text was updated successfully, but these errors were encountered: