go-url-shortener

command module
v0.0.0-...-b9033ce Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

README

go-url-shortener

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

Build Status

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!

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL