48 lines
904 B
Plaintext
48 lines
904 B
Plaintext
http://outils.ft-chatons.local {
|
|
header X-Chatons "miaou"
|
|
|
|
respond /healthcheck "OK"
|
|
|
|
redir / /hello/world
|
|
redir /hello /hello/world
|
|
|
|
handle_path /hello/* {
|
|
respond "Hello {path.0}!"
|
|
}
|
|
|
|
handle /date {
|
|
templates
|
|
respond `{{now | date "2006-01-02 15:04:05"}}`
|
|
}
|
|
|
|
handle /ip {
|
|
respond "{http.request.remote.host}"
|
|
}
|
|
|
|
handle_path /b64/encode/* {
|
|
templates
|
|
respond `{{ .Req.URL.Path | trimPrefix "/" | b64enc }}`
|
|
}
|
|
handle_path /b64/decode/* {
|
|
templates
|
|
respond `{{ .Req.URL.Path | trimPrefix "/" | b64dec }}`
|
|
}
|
|
|
|
basic_auth /secretpage {
|
|
# username "towel" password "poisson"
|
|
towel $2a$14$/cfdN3/kWYwiw/OeAtLcjOxj/NFZa3gUxqePMSoNh1VmoDzS1BP5S
|
|
}
|
|
handle_path /secretpage {
|
|
respond "Welcome, {http.auth.user.id}" 200
|
|
}
|
|
|
|
handle_path /teapot {
|
|
respond "HTML Tea! Tea! Teapot!" 418
|
|
}
|
|
}
|
|
|
|
http://diagrams.ft-chatons.local {
|
|
root * /srv/diagrams
|
|
file_server
|
|
}
|