Redirect for site (#35)

This commit is contained in:
Luke Prior 2021-12-12 22:15:18 +11:00 committed by GitHub
parent 6f6b8a024e
commit 79bdf5cc4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,21 @@ exports.handler = (event, context, callback) => {
callback(null, specific_response);
return;
}
if (request.uri.startsWith('/site/')) {
var site = request.uri.replace(/^\/site\//, "");
var specific_response = {
status: '302',
statusDescription: 'Found',
headers: {
location: [{
key: 'Location',
value: 'https://sondehub.org/#!site=' + site
}],
},
};
callback(null, specific_response);
return;
}
if (request.uri.startsWith('/go/')) {
var name = request.uri.replace(/^\/go\//, "");
if (name == "donate") {