mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2025-01-18 10:46:24 +00:00
Redirect for site (#35)
This commit is contained in:
parent
6f6b8a024e
commit
79bdf5cc4d
@ -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") {
|
||||
|
Loading…
Reference in New Issue
Block a user