Archived, see ivabus/urouter or something else as a replacement
ALIaser for URLs
Small http service to create aliases for URLs.
git clone https://github.com/ivabus/aliurl
cd aliurl
cargo b -r
Add your access_keys (separating by newline) to ./access_keys
or don't add any, if you don't want to use authorization.
Edit Rocket.toml
to set port and ip.
cargo run -r
POST /api/create_alias HTTP/1.1
{
"url": "<URL_TO_BE_ALIASED>",
"alias": "<ALIAS_URI>", // If not provided, random string will be generated
"access_key": "<ACCESS_KEY>" // May not be provided, if no ./access_keys file
"redirect_with_ad": "<BOOL>" //May not be provided, if provided will use ./redirect.html
}
POST /api/create_alias HTTP/1.1
{
"access_key": "<ACCESS_KEY>" // May not be provided, if no ./access_keys file
}
[
{
"alias": "alias_without_ad",
"url": "https://example.com"
},
{
"alias": "alias_with_ad",
"redirect_with_ad": true,
"url": "https://example.com"
}
]
Removes all alias with provided name.
POST /api/remove_alias HTTP/1.1
{
"alias": "<ALIAS>",
"access_key": "<ACCESS_KEY>" // May not be provided, if no ./access_keys file
}
[
{
"alias": "alias",
"url": "https://example.com"
},
{
"alias": "alias",
"redirect_with_ad": true,
"url": "https://another.com"
}
]
[]
GET /<ALIAS> HTTP/1.1
HTTP/1.1 303 See Other
location: <URL>
Aliases for root is declared in src/main.rs
file in INDEX_REDIRECT
const.
See ./redirect.html.example
to understand what's going on.
The project is licensed under the terms of the MIT license.