The responsibility of this API is to create a short URL for a given URL and redirect to the original URL when a short URL is received.
The API accepts only JSON bodies.
Redirects to the original URL.
Name | Path | Type | Description |
---|---|---|---|
id |
URL | string | Generated short URI. By default it's a string with size 7. |
Creates a short URL that redirects to the original URL.
Name | Path | Type | Description |
---|---|---|---|
url |
body | string | Original URL. |
{
"original_url": "https://domain.com/my-long-url",
"short_url": "https://furi.live/abcdefg"
}
It is possible to run only the shortener API locally.
First of all, ensure you have Rust installed.
Then, set the configuration file based on the configuration example file. (Remember to change values if required)
cp ./config-example.toml config.toml
Set the GeoIP database as explained here.
Start the message broker and all databases. This can be done using Docker Compose or manually.
Finally, start the API using:
cargo run