Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

Redirect depending on referrer

node v10.24.1
version: 1.0.0
endpointsharetweet
exports.endpoint = (request, response) => { response.end(`<script> const ref = document.referrer; const redirect = url => { window.alert(\`You will be redirected to\n${url}\`); window.location.href = url; }; if (-1 !== ref.indexOf('WNNJJrm') || -1 !== ref.indexOf('slack.com')) redirect('https://www.iana.org/'); else if (-1 !== ref.indexOf('NWWMMGe') || -1 !== ref.indexOf('google.com')) redirect('https://www.ietf.org/'); else window.alert(\`Unknown referrrer\n(${ref})\`); </script>`); };
Loading…

no comments

    sign in to comment