-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I played a bit to see if this works with the router package like you suggested. This does work out of the box:
app.use(
router('/assets/:file',
serveFiles({
staticDir: `${process.cwd()}/assets`,
})
)
);
In this example, :file isn't used so it doesn't matter what the param is called.
However, the router package doesn't support wildcard matching. So I can request this:
/assets/app.css
but not this:
/assets/css/app.css
I think the unintuitive nature of having to define the route as /assets/:file' (as opposed to just /assets) and not being able to fetch nested assets makes documenting this compatibility not worth it.
Thoughts on adding wildcard matching to @curveball/router to support this package? The underlying package the router relies on is quite old and doesn't support wildcard matching. We'd have to find a new package or implement the route matching ourselves.