I wanted to try and see if I could build an URL shortener in Go.
- Doesn’t create multiple short URLs when you try to shorten the same URL. In this case, the script will simply return the existing short URL for that long URL.
- Redirect to your main website when no shortid, or incorrect shortid, is entered, e.g.
http://localhost:8080/xdf→http://localhost:8080/. - Generates short URLs using only
[a-z0-9]characters.
- Download the source code and install it using the
go installcommand. - Use
database.sqlto create thetiny_urlstable. - Create a config file in
/path/to/url-shortener/namedconfig.(json|yaml|toml). Useconfig-example.jsonas a example.
docker-compose build
docker-compose up
- Add tests
-
- Build Docker image for kuberntes.
- Add deployment