namesmt / hono-adapter-aws-lambda Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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()
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
@antfu/eslint-config
, @vitest/coverage-v8
, hasown
, hono
, is-core-module
, node
, pnpm
, vitest
).devcontainer/Dockerfile
package.json
@namesmt/utils-lambda ^0.0.2
@types/aws-lambda ^8.10.141
consola ^3.2.3
hono ^4.5.0
std-env ^3.7.0
@antfu/eslint-config ^2.23.0
@types/node ^20.14.11
@unocss/eslint-plugin ^0.61.5
@vitest/coverage-v8 ^2.0.3
eslint ^9.7.0
klona ^2.0.6
lint-staged ^15.2.7
simple-git-hooks ^2.11.1
tsx ^4.16.2
typescript ^5.5.3
unbuild ^2.0.0
vitest ^2.0.3
node >=18.20.3
pnpm 9.5.0
hasown ^1
is-core-module ^1
playground/package.json
nodemon ^3.1.4
vite ^5.3.4
vite-plugin-inspect ^0.8.5
The current implementation simply declares a custom method (TRIGGER
) and lets hono
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:
app.eventRoute('aws:s3', 'log')
app.eventRoute('aws:s3', 'copyToPrivateStoreIfNeeded') // If condition met then copy and returns the new path
app.eventRoute('aws:s3', 'emailIfNeeded') // If condition met then sends email and returns true
One event comes in and it returns something like:
const res = {
log: true,
copyToPrivateStoreIfNeeded: "a/b/c.file",
emailIfNeeded: false,
}
It was amazing and supports the usecase of a complex applications, like what if both api/book/*
and api/user/*
both wants to register a trigger handler on aws:s3
?.
I hope we could bring it to this adapter too.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.