Skip to content

How to prefix-match path in oak router??????????????????????????????????? #698

@ledlamp

Description

@ledlamp

In express I serve folder to a path like this

app.use("/v/", express.static(process.env.DOWNLOADS));

In oak I try to do like this but it does not work, the route does not even get hit at all

router.get("/v/", async ctx => {
	await ctx.send({
		root: process.env.MEDIA_DIR
	});
});

If I put "/v/*" I get error: Uncaught (in promise) TypeError: Unexpected MODIFIER at 3, expected END so it seems glob * is not supported.

It seems the only thing I can do is /v/:uselessparam but then it will not match path like /v/foo/bar.

Is there seriously no way to make a route like /foo/ that matches all paths underneath like /foo/bar and /foo/bar/baz?????

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions