Skip to content

A URL-SHORTENER API that uses Golang and MongoDB and works similarly like bit.ly .

License

Notifications You must be signed in to change notification settings

edwinnduti/go-url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-url-shortener

A URL-SHORTENER API that uses Golang and MongoDB and works similarly like bit.ly .

License: MIT Build Status License: MIT

A REST API url-shortener made in Golang.

Requirements

  • GOLANG
  • POSTMAN
  • MONGO COMPASS GUI

You can run it locally and online:

Locally
$ git clone https://github.com/edwinnduti/go-url-shortener.git
$ cd go-url-shortener
$ go install
$ export MONGOURI=mongodb://localhost:27017
$ sudo service mongod start
$ go run main.go

Available locally:

function path method
Create shorturl / POST
Get single url /{id} GET
Get redirected /{urlid} GET
Delete single url /{id} DELETE
update single user /{id} UPDATE
Get longurl /expand GET
Online
$ curl -X POST -H "Content-Type:application/json" -d {"longurl": "<enter longurl e.g https://google.com/search?=Skygardener>"} https://localhost:8045/

Have Fun!

About

A URL-SHORTENER API that uses Golang and MongoDB and works similarly like bit.ly .

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages