2023-06-21 08:57:00 +03:00
|
|
|
# urouter
|
|
|
|
|
2023-12-18 13:50:15 +03:00
|
|
|
Static (list of routes read once) http router for routing small domains.
|
2023-06-21 08:57:00 +03:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
```shell
|
|
|
|
git clone https://github.com/ivabus/urouter
|
|
|
|
cd urouter
|
|
|
|
```
|
|
|
|
|
2023-12-18 13:50:15 +03:00
|
|
|
Edit `alias.json` (or any other JSON file, check `--alias-file` option) and `cargo run`
|
2023-06-21 08:57:00 +03:00
|
|
|
|
|
|
|
## `alias.json` example
|
|
|
|
|
|
|
|
```json
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"uri": "uri",
|
|
|
|
"alias": "file"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"uri": "uri2",
|
|
|
|
"alias": "http://example.com",
|
|
|
|
"is_url": true
|
2023-09-10 12:31:19 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"uri": "/",
|
|
|
|
"alias": "https://somecoolscript.sh",
|
|
|
|
"is_url": true,
|
|
|
|
"curl_only": true
|
2023-06-21 08:57:00 +03:00
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
2023-09-10 12:31:19 +03:00
|
|
|
`"curl_only"` thing for `curl https://url | sh` like scripts.
|
|
|
|
|
2023-06-21 08:57:00 +03:00
|
|
|
## License
|
|
|
|
|
2023-09-11 13:51:58 +03:00
|
|
|
The project is licensed under the terms of the [MIT license](./LICENSE).
|