change config format to be more flexible

This commit is contained in:
Dustin Thomas 2025-06-06 12:35:00 -04:00
parent 34956ed925
commit 710e6d64b1
Signed by: cptlobster
GPG key ID: 33D607425C830B4C
3 changed files with 65 additions and 30 deletions

View file

@ -1,10 +1,18 @@
# This is an example Stargate configuration file that defines a couple of routes to match against.
# Regex can be disabled by uncommenting the following line:
#use_regex = false
[[routes]]
from = "a"
to = "https://cptlobster.dev"
[[routes]]
from = "b"
to = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
[[routes]]
from = "d"
to = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
[routes]
# These routes will exactly match the specified strings.
"a" = "https://cptlobster.dev"
"b" = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
# This is a simple regex matcher. It will match any string that ends in "ic".
".*ic" = "https://en.wikipedia.org/wiki/Special:Random"
[[routes]]
from = ".*ic"
to = "https://en.wikipedia.org/wiki/Special:Random"
using = "regex"