Skip to content

Instantly share code, notes, and snippets.

@thomasvds
Created December 5, 2018 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasvds/ecc0a5e0684f2c7bed4c1794ef61336d to your computer and use it in GitHub Desktop.
Save thomasvds/ecc0a5e0684f2c7bed4c1794ef61336d to your computer and use it in GitHub Desktop.
exports.handler = async (event) => {
const params = event.queryStringParameters;
const environment = params.environment;
let redirectionUrl;
switch(environment){
case 'development':
url = "http://localhost:8080";
break;
case 'staging':
url = "https://staging.example.com";
break;
case 'production':
url = "https://example.com";
};
const response = {
statusCode: 302,
headers: {
"Location" : redirectionUrl,
},
body: null
};
return response;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment