Skip to content

SHAPPY0/url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

This is a URL shortener app based on GoLang. It exposes APIs to generate short urls. All urls get stored in Memory.

SetUp:

  1. Clone the repositroy.
  2. Run go mod download to download all the dependency modules.
  3. Run go run main.go to run the server
  4. Server will start on 8001 port

APIs

1. Generate Short URL

URL: http://localhost:8001/short-url

Method: POST

Request Body:

{"url": "<original_url>"}

Response:

  {"success": true, "shortUrl": "<short_url>"}

2. Open URL

Open URL http://localhost:8001/u/<short_url> in browser. It will redirect to the original url if short url is valid.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages