A URL Shortener Powered by Cloudflare Worker with password protection feature.
This project is based on the work done by xyTom/Url-Shorten-Worker. I added a small javascript to prompt password to verify the user since ideally you do not want this service to be completely public because this kind of url shorten site usually will gett abused usage as the original author faced. Again, this is a simple javascript and no security consideration. Once tested with a better code, it will be replaced right away.
Cloudflare works has 100k/day requests limistation, which is enough for a small project to use.
Getting start:
Go to Workers KV and create a namespace.
Github project: https://oVo-HxBots/Url-Shorten-By-CF-Worker Go and Fork This Project & Follow Bellow Steps.
1. Go to Workers KV and create a namespace:
2. Create a new worker:
Go to the Settings tab of the Worker and bind the KV Namespace
3. Bind an instance of a KV Namespace to access its data in this new created Worker:
4. Where Variable name is filled LINKS in, KV namespace is filled in the namespace you just created:
5. Copy the index.js code in this project to Cloudflare Worker:
Click Save and Deploy
Add Password to Links (Optional):
This code has been put into index.html file. You might want to change it based on your needs.
<SCRIPT language="JavaScript">var password;var pass1="hxbots";password=prompt('Please enter your password to view this page!',' ');if (password!=pass1) window.location="https://hxbots.in.eu.org";else { alert('Password Correct! Click OK to enter!'); }</SCRIPT>