The Corpora of the Universität Leipzig, licensed under CC BY, are used for generating the wordlists. (Terms of Usage) You can download the files here: Corpora.
Method | Path | Description | Body | Response |
---|---|---|---|---|
POST |
|
Short a URL via wordlist |
The URL to shorten |
The shortened URL |
POST |
|
Short a URL via random characters |
The URL to shorten |
The shortened URL |
DELETE |
|
Deletes a shortened URL
Note that this is the same URL as the |
||
GET |
|
Redirects to the matching |
|
You can configure shorty
via environment variables. You can set those via the --env
tag:
Name |
Default |
Description |
BASE_URL |
The URL returned when shortening urls. |
|
CHARED_LENGTH |
|
The length of the random characters used for shortened URL’s. |
WORDED_LENGTH |
|
The length of the random words used for shortened URL’s. |
PASSWORD |
NOT-SET |
If set |
You can run shorty
with docker
or podman
:
podman run -p 8000:8000 ghcr.io/modprog/shorty
or
docker run -p 8000:8000 ghcr.io/modprog/shorty
To set all configurable options:
podman run -p 8000:8000 \
--env WORDED_LENGTH=1 --env CHARED_LENGTH=4 --env BASE_URL=http://127.0.0.1:8000/ \
ghcr.io/modprog/shorty
To shorten a URL make a POST
request:
Using the wordlist:
curl -X POST http://localhost:8000/w -d https://togglebit.io/posts/terminal-game-jam/
Using random characters:
curl -X POST http://localhost:8000/c -d https://togglebit.io/posts/terminal-game-jam/
Afterwards just open the returned URL in a browser of your choice.