Skip to content

timpratim/urlshortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener

A simple URL shortener written in Go.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Things you need on your machine.

  • Go
  • Any text editor or IDE

Installing

Clone the repository to your local machine.

git clone https://github.com/timpratim/url-shortener.git

Change into the project directory:

cd url-shortener

Build the project:

go build

Run the project:

go run main.go

Usage

curl -X POST -d "url=https://twitter.com/BhosalePratim" http://localhost:8080/shorten
  • The response will be a JSON object containing the short URL:
{"short_url":"http://localhost:8080/abc123"}

Redirecting to the Original URL

To redirect to the original URL, make a GET request to the short URL:

This will redirect you to the original URL.

Built With

Go - The programming language.

Authors

Pratim Bhosale

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages