Skip to content

sigfriedCub1990/frodo-url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frodo, the URL shortener

Motivation

  • To have fun building a simple URL shortener using a non-cryptographic hash function from the MurmurHash family. I chose Murmurhash based on this answer.
  • To learn how to setup a simple environment using Docker, Redis and Node.js.

Installation

    # To run the URL shortener run the following `two` commands
    docker-compose build
    docker-compose up -d
    # You can still use `redis` and run the `Gandalf` container :)
    docker-compose build
    docker-compose up -d redis
    npm run dev

Usage

    curl --data '{"url": "https://sigfried.xyz"}' --header 'Content-Type: application/json' http://localhost:3000/api/v1/shorten
    # Response will be a JSON with an URL
    ```json
    { "url": "localhost:3000/c19fcdc5" }
    ```
    # Next step is to put the returned URL in your browser
    # and you'll be redirected to the original URL, i.e. https://sigfried.xyz.

Example API

About

This is Frodo, the URL shortener 😊

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published