https://github.com/levpay/surl
URL Shortener
https://github.com/levpay/surl
golang url-shortener url-shortener-microservice
Last synced: 5 months ago
JSON representation
URL Shortener
- Host: GitHub
- URL: https://github.com/levpay/surl
- Owner: levpay
- License: mit
- Created: 2019-01-28T13:24:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-12T03:15:58.000Z (over 5 years ago)
- Last Synced: 2024-06-20T12:01:21.799Z (almost 2 years ago)
- Topics: golang, url-shortener, url-shortener-microservice
- Language: Go
- Size: 14.6 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sURL
URL Shortener used by [levpay](https://github.com/levpay)
## Example
``` shell
curl -i 'http://127.0.0.1:8080/' -H 'Content-Type: application/json; charset=UTF-8' --data-binary '{"url":"https://www.google.com/"}' --compressed
HTTP/1.1 201 Created
Content-Type: application/json
Date: Mon, 28 Jan 2019 13:29:10 GMT
Content-Length: 50
{"url":"https://www.google.com/","short":"XBvHFJ"}%
```
### redirect
``` shell
curl -i http://127.0.0.1:8080/XBvHFJ
HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=utf-8
Location: https://www.google.com/
Date: Mon, 28 Jan 2019 13:30:26 GMT
Content-Length: 58
Moved Permanently.
```