Compare commits

...

4 Commits

Author SHA1 Message Date
d00b9e1c9e Update 'README.md' 2022-09-27 15:05:16 +00:00
e4ca15f0c2 Update 'README.md' 2022-08-28 21:36:38 +00:00
8f1cb33eba Update 'README.md' 2022-08-28 13:24:55 +00:00
9d68dfc3ba Updated README.md 2022-08-28 15:23:17 +02:00

View File

@@ -1,15 +1,39 @@
# 5feet11
A URL shortener that generates links even shorter than 5'11.
A scalable URL shortener.
## Prepare
- ScyllaDB
- Prometheus*
*: Optional
## Run
Update the config at `etc/fivefeeteleven-api.yaml`.
```sh
# Docker
docker run -it $(docker build -q .)
# Compile
make build && ./5feet11
```
## Usage
```bash
# Shorten a URL
curl --header "Content-Type: application/json" \
--request POST \
--data '{"longUrl":"https://news.ycombinator.com"}' \
curl -X POST -H "Content-Type: application/json" \
-d '{"longUrl":"https://news.ycombinator.com"}' \
http://localhost:5111/api/v1/links
# Shorten a URL that expires after N seconds
curl -X POST -H "Content-Type: application/json" \
-d '{"longUrl":"https://news.ycombinator.com", "expiresAfter": 30}' \
http://localhost:5111/api/v1/links
# Expand the URL
curl -iL http://localhost:5111/{id}
# Get information of a specific URL
curl -iL http://localhost:5111/api/v1/links/{id}
```