Skip to content

Patrick564/slash-url-short

Repository files navigation

Url Shortener

Url shortener API made with Go, Gin and Redis and documented with Swagger. Deploy to Railway using Redis Cloud.

api image with swagger

Run

This project use default enviroment variables, redis addr is '127.0.0.1:6379' and other values are empty. Unless other variables are found. Just exec:

go run .

The url for documentations is http://localhost:8080/swagger/index.html

Tests

To run all tests in project exec:

go test ./...

Endpoints

  • GET /:id Redirect to original url.
  • POST /create Create a new short url, if already exists returns previous url.

Other

This project also have a gRPC version here.