Categorygithub.com/GP-95/short-url
module
0.0.0-20240521191151-c66de3a272c1
Repository: https://github.com/gp-95/short-url.git
Documentation: pkg.go.dev

# README

URL Shortener

How to run

  1. Make sure docker is installed and running and run the following command
docker compose up
  1. Make a POST request to localhost:3000/shorten with the body using the body containing JSON structure
{"url": "http://www.google.com"}

  • Note that the URL has to start with http:// or https:// due to "validation"

  • The expected response is

{"code": "1381a8b29f7"}
  1. Take the code from the response and make a GET request to localhost:3000/<code> the expected response is
{"url": "http://www.google.com"}

# Packages

No description provided by the author