mirror of
https://github.com/ivabus/urouter
synced 2024-11-22 08:25:11 +03:00
40 lines
688 B
Markdown
40 lines
688 B
Markdown
# urouter
|
|
|
|
Static (list of routes read once) http router for routing small domains.
|
|
|
|
## Installation
|
|
|
|
```shell
|
|
git clone https://github.com/ivabus/urouter
|
|
cd urouter
|
|
```
|
|
|
|
Edit `alias.json` (or any other JSON file, check `--alias-file` option) and `cargo run`
|
|
|
|
## `alias.json` example
|
|
|
|
```json
|
|
[
|
|
{
|
|
"uri": "uri",
|
|
"alias": "file"
|
|
},
|
|
{
|
|
"uri": "uri2",
|
|
"alias": "http://example.com",
|
|
"is_url": true
|
|
},
|
|
{
|
|
"uri": "/",
|
|
"alias": "https://somecoolscript.sh",
|
|
"is_url": true,
|
|
"curl_only": true
|
|
}
|
|
]
|
|
```
|
|
|
|
`"curl_only"` thing for `curl https://url | sh` like scripts.
|
|
|
|
## License
|
|
|
|
The project is licensed under the terms of the [MIT license](./LICENSE).
|