Closed NamesMT closed 1 week ago
I have just released a canary version for the PoC of the new processing of trigger routes, here is some notable features:
$!
(rootTakeover) and $=
(rootReturn) as the route id for some edge cases such as returning a stream.getTriggerPath()
and manual .on('TRIGGER') method declare, now just create a factory from the root instance, import it anywhere and triggerFactory.on(eventSource, routeId, ..handlers)
, fully middleware handlers support just like normal Hono route!
.internalApp
on the factory.
The current implementation simply declares a custom method (
TRIGGER
) and letshono
internal processes mostly everything, this approach allows a familiar syntax with normal hono routes and allowing using the same processing logic via with the current adapter but poses some limitation:fixTriggerRoutes
is required if basePath /.route
grouping is used.In
lambda-voie
, I designed the.eventRoute
(trigger events) processing to be able to register multiple routes for the same eventSource (like:aws:s3
), so that we could do many things for the same event and it would returns an object containing all responses from all registered handlers, something like:One event comes in and it returns something like:
It was amazing and supports the usecase of a complex applications, like what if both
api/book/*
andapi/user/*
both wants to register a trigger handler onaws:s3
?.I hope we could bring it to this adapter too.