Way to negate a path pattern? #2138
Unanswered
daniel-nagy
asked this question in
Q&A
Replies: 1 comment
-
I realize now that what I really wanted to do was match any path that was not a file. This is my workaround. app.get("*", (context: HonoContext, next: Next) => {
if (!extname(context.req.path)) {
// GET request for non-file
}
return next();
}); Not sure if there is a way to express that using the route syntax. |
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
-
Hi,
I want to negate a path pattern but cannot find any documentation on how to do it. Essentially I want to match any path that doesn't start with
/assets
. I tried using glob not patternsas well as negative lookbehind
but neither worked.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions