zilla icon indicating copy to clipboard operation
zilla copied to clipboard

Support default welcome path in http-filesystem binding

Open jfallows opened this issue 3 years ago • 1 comments

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.

jfallows avatar May 19 '22 18:05 jfallows

Hey @jfallows, I would like to give this issue a try. Can you please assign this to me?

ankitk-me avatar Oct 29 '22 07:10 ankitk-me