An open API service indexing awesome lists of open source software.

https://github.com/nemuelw/ushortener

URL Shortening Service
https://github.com/nemuelw/ushortener

backend backend-api backend-service gin gin-gonic golang rest-api restful-api server url url-shortener

Last synced: about 1 year ago
JSON representation

URL Shortening Service

Awesome Lists containing this project

README

          

# ushortener

URL Shortening Service

## Installation

- Clone this repository onto your local machine

```
git clone https://github.com/nemzyxt/ushortener.git
```

- Navigate to the project directory and install required packages

```
go get
```

## Testing

```
go test
```

## Usage

Start the server

```
go run server.go
```

You can now use the service via its endpoints

## Example

Request:

```
POST http://localhost:1234/shorten
Content-Type: application/json

{
"longURL": "https://github.com/nemzyxt/ushortener"
}
```

Sample response:

```
{
"shortURL": "http://localhost:1234/AO_2paiIg"
}
```