This is a URL shortener service. You can generate a short URL by a long URL. Moreover, you can make your alias of short URL.
- Generate short URL by long URL
- Redirect to long URL by generated URL
- URL generation supports custom alias
- No need to run main.go file, you can type the below command in the terminal directly.
- The app may sleep without using. Just wait for a few seconds to wake it up.
> curl -X POST -H "Content-Type: application/json" -d '{"longUrl" : "https://www.youtube.com/", "alias":""}' "https://short-url-sample.herokuapp.com/api/url-shortener/v1/url"
GET
/swagger/*anyGET
/healthGET
/versionGET
/:idPOST
/api/url-shortener/v1/url
- Golang
- Gin framework >= 1.7
- Docker
- MongoDB
> docker pull mongo:3.6
> docker run -p 27017:27017 mongo:3.6
> go run main.go
> curl -X POST -H "Content-Type: application/json" -d '{"longUrl" : "https://www.youtube.com/", "alias":""}' "http://localhost:8080/api/url-shortener/v1/url"
- RESTful API
- Swagger
- Gin
- Golang
- MongoDB
- Docker
- Github action(CI)
- Heroku (CD)
- mongoDB add expired time field
- Add redis for cache
- MockDB for testing
- Deploy to AWS