useid / handlersjs

MIT License
3 stars 3 forks source link

Add support for wildcard path matching #239

Open lem-onade opened 1 year ago

lem-onade commented 1 year ago

E.g.

"path": "/*"

Should match every possible path:

https://handlers.js/hello https://handlers.js/hello-world https://handlers.js/hello/world https://handlers.js/hello/world/exclamation

Currently, the only wildcard-like functionality that is available, is using variables in the path ("path": "/:some-variable"). However, this only allows for a "wildcard" on the base URl/root. Any nested path will not match:

https://handlers.js/hello -> match https://handlers.js/hello-world -> match https://handlers.js/hello/world -> no match https://handlers.js/hello/world/exclamation -> no match