需要webpack,webpack-dev-server
npm install webapck webpack-dev-server --save-dev
設置時
devServer: { historyApiFallback: true, hot: true, inline: true, stats: { colors: true }, proxy: { '/list': { target: 'https://api.github.com', pathRewrite: {'^/column' : '/column'}, changeOrigin: true } } },
這段代碼就是將 '/list' 通過本地開發服務器webpack-dev-server轉發到 'https://api.github.com'