Build a Free Online Notepad Using URL Shortener Worker

Requirement

I believe everyone has already used many online notepad applications, such as: 

https://gist.github.com/

https://pastebin.ubuntu.com/

Actually, I've had this idea for a long time. A short link service is essentially about inputting a Key and returning a Value. It just does one more step, treating the Value as the target URL and automatically redirecting to it.

So what if we don't do the redirect? We simply display the Value corresponding to the Key, and that would be a simple online notepad.

Approach

To be honest, once the approach is clear, there's not much worth introducing about the development process.

A switch was added.

If shorturl_system is true, 

then when the API adds a record, it will verify whether the Value is a valid URL.

When querying, there is one step of 302 redirect (which is the functionality of the original project). Skipped.


If shorturl_system is false, 

Then when using the Key as a path to access the worker, it only displays the Value.


========

End

Github: https://github.com/crazypeace/url-Shorten-Worker/

Demo: https://pastebin.icdyct.cloudns.asia/tieludasiliqiuweiyue

========

update

========

Postscript

I suppose, like other online notepads, many people want to use it to host proxy node subscriptions. Note that you should set the Key (custom short link) to be long, and it can be especially long.

You can refer to this password generator. http://git.io/xkcdpw

Comments