0
点赞
收藏
分享

微信扫一扫

前端项目实战肆佰零玖react-admin和material ui-跨域方案http-proxy-middleware


const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = (app) => {
    app.use(
        createProxyMiddleware('/postgrest', {
            target: 'http://localhost:4000',
            changeOrigin: true,
            pathRewrite: {
                '^/postgrest': ''
            }
        })
    )
}

举报

相关推荐

0 条评论