How to configure reverse proxy in vue (front-end and back-end joint debugging to solve cross-domain)

How to configure reverse proxy in vue (solve cross-domain)

1. The front and back computers are connected to the same LAN.
2. Change the reverse proxy in config/index.js (find the following code and change target to the back-end ip address and port number)

proxyTable: {
	'/api': {
		target: 'http://localhost:3000',//需要代理的地址
		changeOrigin: true,
		pathRewrite: {
		 	 '^/api':""
		}
	}
}

Guess you like

Origin blog.csdn.net/qq_43923146/article/details/109246610