We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
第2040天 在webpack中,怎么做代理?
3+1官网
我也要出题
The text was updated successfully, but these errors were encountered:
使用webpack-dev-server的代理功能
const path = require('path'); module.exports = { // ...其他配置 devServer: { contentBase: path.join(__dirname, 'dist'), compress: true, port: 9000, proxy: { '/api': { target: 'http://localhost:5000', // 目标服务器地址 changeOrigin: true, // 对于虚拟托管的网站,这个项需要设置为true pathRewrite: { '^/api': '' }, // 重写路径 } } } };
在这个示例中,任何以 /api 开头的请求都会被代理到 http://localhost:5000。
Sorry, something went wrong.
No branches or pull requests
第2040天 在webpack中,怎么做代理?
3+1官网
我也要出题
The text was updated successfully, but these errors were encountered: