Greg Daynes

Full Stack Software Design, Development & Management

Lazy Short URLs

Recently when a friend was interviewing for a job, one of the code challenges was to create a url shortener. I decided to give it a try.

Repo: gregdaynes/shortr

# Run application web server on port 3000
$ npm start
  • Encode the received url with HMAC from Node’s internal crypto library - Link
  • Append an entry ${hash}:${url} to a plaintext file - link
  • Stores hash:url in a Set (Restored from the plaintext file on start) - link