
Product
Introducing Repository Labels and Security Policies
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
hapi-aws-lambda
Advanced tools
Call AWS lambda functions from your hapi apps! And get all the goodness of server methods, including free caching.
const Hapi = require('hapi');
const server = new Hapi.Server();
server.connection({ port: 4000 });
server.register({
register: require('hapi-aws-lambda'),
options: {
config: {
region: 'us-east-1',
credentials: {
accessKeyId: 'XXX',
secretAccessKey: 'XXX'
}
}
}
}, (err) => {
if (err) {
throw err;
}
// Use it here!
server.start(() => {
console.log('Server started!');
});
});
The lamda handler
server.route({
method: 'GET',
path: '/',
handler: {
lambda: {
func: 'myExampleFunction', // short name or full arn
payload: { name: 'matt' }
}
}
});
The lamda server method (free caching for your lambdas!)
server.lambda('myExampleFunction', {
cache: {
expiresIn: 10000
}
});
server.route({
method: 'GET',
path: '/',
handler: function (request, reply) {
server.methods.myExampleFunction({ name: 'matt' }, (err, data) => {
if (err) {
throw err;
}
reply(data);
});
}
});
FAQs
Call AWS lambda functions from your hapi app!
We found that hapi-aws-lambda demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket is introducing a new way to organize repositories and apply repository-specific security policies.
Research
Security News
Socket researchers uncovered malicious npm and PyPI packages that steal crypto wallet credentials using Google Analytics and Telegram for exfiltration.
Product
Socket now supports .NET, bringing supply chain security and SBOM accuracy to NuGet and MSBuild-powered C# projects.