Go is a tiny Node.js application I worked on and put together in about 4-5 hours.
I usually take a lot longer working on projects so under 5 hours was very very quick for me.
I decided to use go.mhmd.us because I already am using mhmd.us
to host my droplr links and content.
I'd like to welcome you to try out this URL shortener with the caveat that it is only for demo purposes right now.
You can start using it by sending a curl request like below:
curl -X POST \ http://go.mhmd.us/shorten \ -H 'Content-Type: application/json' \ -d '{ "url": "https://your-long-url.com", }'
"custom"
key/value pair to get a custom path. OK 200
with the JSON response including the short and long links.
I decided to try the simplest way to create a key/value pair system to save the data necessary to run a URL shortener.
So, I went with using two JSON files to save long and short URL pairs.
I am using two JSON files, one where the short URL is the key and one where the long URL is the key.
short-links.json { "about": "http://usmanity.com/projects/go" }The above shows this page's entry in the JSON file for short links.
The lookup speeds for each file are
The size of the file will continue to increase so I will add a way to check the average lookup time for links over a
certain period of time.