Short link is a URL shortening service.
ShortLink is a URL shortening service where you enter a URL such as https://indicina.co
and it returns
a short URL such as http://short.est/GeAi9K
. Visiting the shortened URL should redirect the user to the
long URL. Using the example above, visiting http://short.est/GeAi9K
should redirect the user to https://indicina.co
encode
: Encode a URL to a shortened URLdecode
: Decodes a shortened URL to its original URLstatistic/{url_path}
: Return the basic statistics of a short URL path. Using the above link,url_path
will beGeAi9K
.
Overall, the project is designed to be scalable, maintainable and extensible. The use of a monolithic architecture that can easily spin off to a micro-service following modular architecture pattern that promotes code organization and separation of concerns.
PORT=XXXX
NODE_ENV=development
- Navigate to
http://localhost:8282/api-docs
on your computer to view the openapi documentation.
$ git clone https://github.com/sheygs13/shortlink-api.git
$ cd shortlink-api
$ npm install
- Run
npm install
to install project dependencies - Run
npm run dev
to run the services and you are good - Open browser and visit
http://localhost:8282
- Install Docker
- Run
docker-compose up -d
. But If you like to see those clumsy logs 😬, RUNdocker-compose up
- Open browser and visit
http://localhost:8282
- RUN
npm run prod
to start the production build
docker build -t ${IMAGETAG} -f Dockerfile .
$ npm test