If you write "*" or "**" in proxy the path that you wanted to be proxied, which in webpack would mean "all paths" I would get all the paths to be proxied.
What is actually happening?
I am getting an error: Invalid regular expression: /*/
I ve found that Vue Cli does not support such regular expressions, and in general the api for the dev server and proxy are limited to string or objects.
How could I write this code so it would proxy ALL requests?
Thanks
rewrite the path to remove that subpath so your real backend received /* requests
in your app's requests, conditionally append that subpath to all requests in dev, but not in prod (so prod does requests against / whereas dev does make requests against `/api/) using an [environment variable](https://cli.vuejs.org/guide/mode-and-env.html#environment-variables) The latter should usually be done centrally, i.e. axios offers abasePath` like option.
Version
5.0.8
Environment info
Steps to reproduce
`//vue.config.js
module.exports = defineConfig({ publicPath: "./", filenameHashing: false, productionSourceMap: false, outputDir: outputDir, devServer: { server: "https", port: devServerUrl.port, host: devServerUrl.hostname, headers: { "Access-Control-Allow-Origin": "", "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS", "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization" }, proxy: { "": { // <--- here is the problem target: iisServerUrl.origin, changeOrigin: true, secure: false, cookieDomainRewrite: devServerUrl.hostname, hostRewrite: devServerUrl.host, onProxyReq: function (proxyReq, req) { var protocolWithoutColon = devServerUrl.protocol.substr(0, devServerUrl.protocol.length - 1); proxyReq.setHeader("Forwarded",
host=${devServerUrl.host};proto=${protocolWithoutColon}
); }, router: {});`
What is expected?
If you write "*" or "**" in proxy the path that you wanted to be proxied, which in webpack would mean "all paths" I would get all the paths to be proxied.
What is actually happening?
I am getting an error: Invalid regular expression: /*/
I ve found that Vue Cli does not support such regular expressions, and in general the api for the dev server and proxy are limited to string or objects.
How could I write this code so it would proxy ALL requests? Thanks