Created
December 5, 2018 02:59
-
-
Save thomasvds/ecc0a5e0684f2c7bed4c1794ef61336d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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