Skip to content
On this page

proxy 跨域

javascript
server: {
    proxy: {
        '/api': {
            target: 'https://baidu.com',
            changeOrigin: true,
            rewrite: (path) => path.replace(/^\/api/, '')
        }
    }
},
1
2
3
4
5
6
7
8
9

Released under the MIT License.