Go to file
Ivan Bushchik e84e1a3317
0.5.0: Advanced agent matching
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
2023-12-21 17:04:44 +03:00
src 0.5.0: Advanced agent matching 2023-12-21 17:04:44 +03:00
.gitignore Fork ivabus/aliurl 2023-06-20 21:02:27 +03:00
.rustfmt.toml Fork ivabus/aliurl 2023-06-20 21:02:27 +03:00
Cargo.toml 0.5.0: Advanced agent matching 2023-12-21 17:04:44 +03:00
LICENSE Add README.md and LICENSE 2023-06-21 08:57:00 +03:00
README.md 0.5.0: Advanced agent matching 2023-12-21 17:04:44 +03:00

urouter

Static (list of routes read once) http router for routing small domains.

Installation

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

[
  {
    "uri":"/",
    "alias": {
      "url":  "https://somecoolwebsite"
    }
  },
  {
    "uri":"/",
    "alias": {
      "file": "somecoolscript"
    },
    "agent": {
      "regex": "^curl/[0-9].[0-9].[0-9]$",
      "only_matching": false
    }
  },
  {
    "uri":"/text",
    "alias": {
      "text": "sometext"
    }
  }
]

Agent matching made for curl https://url | sh like scripts.

License

The project is licensed under the terms of the MIT license.