How to use hops-lambda - 2 common examples

To help you get started, we’ve selected a few hops-lambda examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xing / hops / packages / spec / integration / lambda / __tests__ / build.js View on Github external
function invokeFunction(root, path) {
  process.chdir(root);
  const { handler } = require('hops-lambda/lambda');
  return handler({ requestContext: { path }, path }, {}).then(response => {
    if (response.isBase64Encoded) {
      response.body = Buffer.from(response.body, 'base64').toString('utf-8');
    }
    return response;
  });
}
github xing / hops / packages / spec / integration / lambda / __tests__ / build.js View on Github external
async function zipFunctionCode(root) {
  process.chdir(root);
  const hopsConfig = require('hops-config');
  const awsConfig = require('hops-lambda/lib/aws-config')(hopsConfig);

  const tmpDir = await createTmpDirectory();
  const lambdaZipFile = path.join(tmpDir, 'lambda.zip');

  return createBundle(
    root,
    lambdaZipFile,
    awsConfig.include,
    awsConfig.exclude
  );
}

hops-lambda

Quick and easy deployment of Hops applications to AWS Lambda

MIT
Latest version published 2 years ago

Package Health Score

54 / 100
Full package analysis