Skip to content

Latest commit

 

History

History
16 lines (15 loc) · 316 Bytes

CRA v3에서 http proxy 설정.md

File metadata and controls

16 lines (15 loc) · 316 Bytes

src/setupProxy.js 파일을 작성한다.

const proxy = require('http-proxy-middleware');

module.exports = function(app) {
    app.use(
      proxy('/api', {
        target: 'http://localhost:3001',
        changeOrigin: true,
        pathRewrite: {
            '^/api':''
        }
      })
    );
};