go-url-shortener

command module
v0.0.0-...-0f2f850 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: MIT Imports: 12 Imported by: 0

README

go-url-shortener

Go Report Card GoDoc

Simple web service to shorten long urls and keep hash:url key-value maps in MongoDB.

Service database agnostic and can use any DB.

how to

Start a mongo docker container

$ docker run -it -p 27017:27017 mongo

Run service

$ go run . -address "localhost:8080"

Use either curl for testing:

curl -X POST localhost:8080/api/v1/short-url -d '{"Url": "https://host-name/very-long-url?testurl=123&x=y"}'

curl -X GET localhost:8080/api/v1/short-url/c647adf52c439e35daf186bc2a516966

Or SwaggerUI:

http://localhost:8080/swagger/index.html#/

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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