Categorygithub.com/Calgorr/URL_Shortener
modulepackage
0.0.0-20230323120441-02315115d875
Repository: https://github.com/calgorr/url_shortener.git
Documentation: pkg.go.dev

# README

URL Shortener Project

A URL shortener written in Go using the Echo framework and utilizing Postgres and Redis as cache.

Requirements

  • Go 1.16 or higher
  • Postgres
  • Redis

Installation

  1. Clone the repository
  2. Set up the Postgres and Redis instances
  3. Copy the .env.example file to .env and update the environment variables to match your environment.
  4. Run go build to build the project.
  5. Run ./url-shortener to start the server.

Usage

  • To shorten a URL, make a POST request to /new with a body containing the URL:
{ "url": "https://www.example.com/long-url" }
  • The response will contain the shortened URL:
{ "shortUrl": "http://localhost:8080/abc123" }
  • To use the shortened URL, simply visit the returned URL.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

# Packages

No description provided by the author
No description provided by the author
No description provided by the author