Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 894 Bytes

README.md

File metadata and controls

30 lines (26 loc) · 894 Bytes

URL shortener application API

This is a simple URL shortener application API written in Go.
It uses Redis for caching to store token of URL and return domain with token.
API idempotency will be implemented.

How to run

  1. Clone the repository

git clone https://github.com/shari4ov/url-shortener-go
  1. To set domain name for the shortened URLs, change the value of TINY_DOMAIN in docker-compose.yml file

  1. Run the application

task run
  1. Open postman and send a POST request to http://localhost:8080 with the following body:

{
    "url": "https://www.google.com"
}
  1. You will receive a response with the shortened URL:

{
    "url": "http://${TINY_DOMAIN}/1"
}
  1. Open the shortened URL in your browser and you will be redirected to the original URL

http://${TINY_DOMAIN}/1 -> https://www.google.com