Skip to content

Allow routing both "/" and "/index.html" to the same handler #115

@joshuawarner32

Description

@joshuawarner32

Currently, to have a router forward requests for "/" and "/index.html" (and "/js/example.js", etc) to the same handler, I currently have to do something like:

router.get("/", Static::new(Path::new("public")));
router.get("/*", Static::new(Path::new("public"))); // notice the "*"

It would be convenient if I could have both of those redirect to the same handler. For example, this syntax would make sense to me:

router.get("*", Static::new(Path::new("public")));

If there's an option everyone can settle on, I'm happy to take a crack at implementing this.

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions