Skip to content

vinhnhq/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

  1. Submitted by: Vinh Nguyen
  2. Time spent: 3 hours

How to run

Run on terminal

Go to localhost:8080/dogs or localhost:8080/cats

Requirements

The list of redirection should be maintained in a command line tool, what can:

  • Manipulate YAML config file. Where the redirection list peristently stored.
  • Implement append to the list: ./url-shortener configure -a dogs -u www.dogs.com
  • Implement remove from the list: ./url-shortener -d dogs
  • List redirections: ./url-shortener -l
  • Run HTTP server on a given port: ./url-shortener run -p 8080
  • Prints usage info: ./url-shortener -h

Bonus

  • Track number of times each redirection is used. When the user uses urlshorten -l, the user should see redirections ranked by how many times they have been used.
  • Provide a default shortening, if no example is given. For example, if dogs is not given, generate a random alphanumeric string of length 8.
  • Build a Handler that doesn't read from a map but instead reads from a database. Whether you use BoltDB, SQL, or something else is entirely up to you.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages