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
Backreferences in rewrites? #27
Comments
Please try path segments, as described in the documentation: {
"rewrites": [{
"source": "/admin/:suffix",
"destination": "/:suffix"
}]
} |
Thanks, I had seen that, but I assumed it would work as in Express routes in that it matches only one path component (i.e. would match
|
Yes, we implemented it a little differently because it was important for us to allow rewriting the entire ending of a path to a different one. If you want to restrict it, please create more rewrites afterwards that point the other paths to the right one. For every request, all rewrites that match the source are applied - so that should be easy. 👍 |
this does not work if you are running user:~/environment/serve $ ls -lR
.:
total 8
drwxrwxr-x 3 ec2-user ec2-user 4096 Sep 6 15:52 public
-rw-rw-r-- 1 ec2-user ec2-user 114 Sep 6 18:23 serve.json
./public:
total 12
-rw-rw-r-- 1 ec2-user ec2-user 182 Sep 6 16:57 index.html
-rw-rw-r-- 1 ec2-user ec2-user 23 Sep 6 15:44 index.js
drwxrwxr-x 2 ec2-user ec2-user 4096 Sep 6 15:44 static
./public/static:
total 4
-rw-rw-r-- 1 ec2-user ec2-user 24 Sep 6 18:20 style.css serve -s
curl localhost:8080/admin/index.js
# Content of index.html instead |
I think that should be the solution 🤔 {
"rewrites": [{
"source": "/admin/:rest+",
"destination": "/:rest"
}]
} |
@AndyOGo's solution looks like it wasn't tested, because with it I still get the same issue. Here is my abridged
And here is my abridged
|
So is there no way to do this? |
I'm trying to rewrite everything under
/admin
, e.g....and so on.
Can this be accomplished using
rewrites
inserve.json
without specificying every possible path?I tried the following but no luck:
The text was updated successfully, but these errors were encountered: