How to use the aws-serverless-express.getCurrentLambdaInvoke function in aws-serverless-express

To help you get started, we’ve selected a few aws-serverless-express 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 awslabs / aws-serverless-express / examples / alb / src / app.js View on Github external
router.get('/', (req, res) => {
  const currentLambdaInvoke = getCurrentLambdaInvoke()
  res.render('index', {
    apiUrl: currentLambdaInvoke ? `https://${currentLambdaInvoke.event.multiValueHeaders.host[0]}/${currentLambdaInvoke.event.requestContext.stage}` : 'http://localhost:3000'
  })
})

aws-serverless-express

This library enables you to utilize AWS Lambda and Amazon API Gateway to respond to web and API requests using your existing Node.js application framework.

Apache-2.0
Latest version published 3 years ago

Package Health Score

77 / 100
Full package analysis