Replies: 1 comment
-
so only way is to do as middleware outside of router app.use(async ctx => {
if (ctx.request.url.pathname.startsWith("/v/")) {
await ctx.send({
root: process.env.MEDIA_DIR,
path: ctx.request.url.pathname.replace("/v/", "")
});
}
}); this makes messier code, why can't we have wildcard or something??? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In express I serve folder to a path like this
In oak I try to do like this but it does not work, the route does not even get hit at all
If I put
"/v/*"
I geterror: 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
?????Beta Was this translation helpful? Give feedback.
All reactions