server.proxy proxy in vite

  1. Configure the proxy in the server
 server: {
		host: true,
		port: VITE_PORT as unknown as number,
		https: false,
		proxy: {
			'/dev': 'http://10.63.80.113:8000'
		}
	}
  1. After configuration, it is equivalent to replacing the actual request path with http://10.63.80.113:8000/dev
    , that is, adding the key value in the proxy object before the key name

  2. The server-proxy official document in vite

Guess you like

Origin blog.csdn.net/qq_41839808/article/details/123213004