Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@curveball/router support #3

Open
mhum opened this issue Oct 24, 2020 · 0 comments
Open

@curveball/router support #3

mhum opened this issue Oct 24, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@mhum
Copy link
Member

mhum commented Oct 24, 2020

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.

@evert evert removed their assignment Oct 12, 2021
@evert evert added the enhancement New feature or request label Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants