Http proxy
How to use devServer.proxy in Rocketact?
The reference mode of custom proxy configuration is similar to that of custom plugin. You can create one in the root folder of the projectrocketactProxy.js
File, which exports objects that act directly ondevServer.proxy
Configuration, which fully followsdevServer.proxy
The content can be in the following format:
module.exports = {
"/api": {
target: "http://localhost:3000",
changeOrigin: true,
},
};
And then through the package.json Add a new configuration "rocketactproxy" and tell rocketact to load the file:
"rocketactProxy": "./rocketactProxy.js"