Skip to content

Instantly share code, notes, and snippets.

@r1q
Forked from DavidWells/aws-lambda-redirect.js
Created February 11, 2019 22:23
Show Gist options
  • Select an option

  • Save r1q/df9a14bb0189edfe1f4417b15b8f0d85 to your computer and use it in GitHub Desktop.

Select an option

Save r1q/df9a14bb0189edfe1f4417b15b8f0d85 to your computer and use it in GitHub Desktop.
How to do a 301 redirect from an AWS lambda function
exports.handler = (event, context, callback) => {
const response = {
statusCode: 301,
headers: {
Location: 'https://google.com',
}
};
return callback(null, response);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment