- URL Shortening service using Redis
- Fiber: v2
- Database: Redis
http://localhost:3000/api/v1
This endpoint makes an HTTP
POST
request to the specified URL. The request payload should be sent in raw format, with a key"url"
containing the URL value.
{
"url":"https://github.com/Adityasinghvats/url-redis/blob/main/api/helpers/helpers.go",
"short": "urlproject",
"expiry": 5
}
- or just
{
"url":"https://github.com/Adityasinghvats/url-redis/blob/main/api/helpers/helpers.go"
}
The response to this request is in JSON format with the following schema:
{
"url": "https://github.com/Adityasinghvats/url-redis/blob/main/api/helpers/helpers.go",
"short": "localhost:3000/urlproject",
"expiry": 5,
"rate_limit": 9,
"rate_limit_reset": 30
}
The response includes the keys
"url", "short", "expiry", "rate_limit", and "rate_limit_reset"
. The"url"
and"short"
values arestrings
, while"expiry"
,"rate_limit"
, and"rate_limit_reset"
arenumeric
values.
http://localhost:3000/d00603
The url will be ressolved by the backend and you will be redirected to the original url , within seconds.
- Docker
- Golang
git clone https://github.com/Adityasinghvats/url-redis.git
cd url-redis
docker-compose up -d
Guidelines: Outline how others can contribute to your project. Include steps for forking the repository, creating branches, submitting pull requests, and any coding standards or guidelines to follow.
This project is licensed under the MIT License.