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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
⌂ 换网址