https://github.com/tycrek/ruto
a link redirector
https://github.com/tycrek/ruto
deno redirection redirector
Last synced: about 1 year ago
JSON representation
a link redirector
- Host: GitHub
- URL: https://github.com/tycrek/ruto
- Owner: tycrek
- License: isc
- Created: 2025-03-03T08:08:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-05T02:12:32.000Z (about 1 year ago)
- Last Synced: 2025-03-24T07:06:49.690Z (about 1 year ago)
- Topics: deno, redirection, redirector
- Language: TypeScript
- Homepage: https://tycrek.com/classic
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ruto
*a link redirector*
## What is it?
A link redirector I wrote to replace my previous Cloudflare Pages setup that was a little too over-engineered.
## How do I use it?
ruto is simple: Install either [Deno](https://deno.com/) or [Docker Compose](https://docs.docker.com/compose/).
```bash
# Download this project
git clone https://github.com/tycrek/ruto.git
cd ruto/
# Create a redirects.json file
touch redirects.json
# If you chose Deno:
deno task run
# Or you chose Docker:
docker compose up
```
### `redirects.json`
This file configures where ruto will redirect requests. It uses a top-level array containing "routes". Each route can have multiple sources for a single destination. You may also set an optional response code to send, defaulting to `302`.
Example:
```json
[
{
"sources": [ "lh:29035/example", "0.0.0.0:29035/example" ],
"destination": "https://example.com"
},
{
"sources": [ "lh:29035" ],
"destination": "https://example.org"
},
{
"sources": [ "lh:29035/a" ],
"destination": "https://example.org/?foo=hi"
},
{
"sources": [ "mywebsite.com" ],
"destination": "https://google.com",
"code": 301
}
]
```
It is suggested to **not** include `http(s)` in the sources. However, you **must** specify `http(s)` for destinations to ensure proper redirection.