Skip to content

Calgorr/URL_Shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A URL shortener written in Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages