https://github.com/endalk200/blazingly-fast-url-shortener
Blazingly fast URL shortener built using go and redis as storage layer.
https://github.com/endalk200/blazingly-fast-url-shortener
go-url-shortener tiny-url url-short url-shortener
Last synced: 3 months ago
JSON representation
Blazingly fast URL shortener built using go and redis as storage layer.
- Host: GitHub
- URL: https://github.com/endalk200/blazingly-fast-url-shortener
- Owner: endalk200
- Created: 2023-06-19T06:17:42.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-18T23:05:24.000Z (over 1 year ago)
- Last Synced: 2025-01-13T19:40:08.827Z (5 months ago)
- Topics: go-url-shortener, tiny-url, url-short, url-shortener
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blazingly Fast URL Shortener
URL shortener built using go and redis as storage layer.
## Setup and Test
To run and use the server you have to install redis and go. Your redis instance should be up and running on the default port.
Run all integration and unit tests
```bash
go test -v ./...
```Run the server
```bash
go run main.go
```## API
### Create a short URL
```bash
curl --request POST \
--data '{
"long_url": "https://github.com/endalk200/blazingly-fast-url-shortner/blob/main/.gitignore",
"user_id" : "e0dba740-fc4b-4977-872c-d360239e6b10"
}' \
http://localhost:9808/create-short-url
```The above endpoint should return a response like this
```json
{
"message": "short url created successfully",
"short_url": "http://localhost:9808/9Zatkhpi"
}
```### Get a short URL
```bash
curl --request GET \
--url 'http://localhost:9808/get-short-url?short_url=1'
```