zilla
zilla copied to clipboard
Support default welcome path in http-filesystem binding
When request arrives for / then support propagating a default filename, such as index.html.
This can be handled by a routing rule such as:
{
"type" : "http-filesystem",
"kind": "proxy",
"routes":
[
{
"when":
[
{
"path": "/"
}
],
"exit": "filesystem_server0",
"with":
{
"path": "index.html"
}
},
{
"when":
[
{
"path": "/{path}"
}
],
"exit": "filesystem_server0",
"with":
{
"path": "${params.path}"
}
}
]
}
However, it may be more helpful to support the concept of a welcome-path in http-filesystem binding options.
{
"type" : "http-filesystem",
"kind": "proxy",
"options":
{
"welcome-path": "/index.html"
}
"routes":
[
{
"when":
[
{
"path": "/{path}"
}
],
"exit": "filesystem_server0",
"with":
{
"path": "${params.path}"
}
}
]
}
Then when the / request arrives, it is treated as if it was /index.html.
Hey @jfallows, I would like to give this issue a try. Can you please assign this to me?