A dead-simple cloudflare worker for resolving URL redirects.
It does not perform any caching or whatsoever.
If the passed URL has no protocol, https://
will be prepended.
Set the environment variable ACCEPTED_API_TOKENS
to a list of accepted Bearer Tokens seperated by spaces.
e.g. ACCEPTED_API_TOKENS="token1 token2 token3"
Run the project locally using yarn start --local --var ACCEPTED_API_TOKENS:justtesting
GET <worker url>/?target=[url to resolve]
Send one of the configured API Tokens as a Bearer Token in the Authorization header.
HTTPIE: http -A bearer -a justtesting "http://localhost:8787/?target=https://amzn.to"
CURL: curl -H "Authorization: Bearer justtesting" "http://localhost:8787/?target=https://amzn.to"
This work is licensed under the CC-0 (No Rights Reserved) License.
Do what you want, I'm not liable for anything you do with this code.