728x90
같은 local에서 테스트 할 경우에서만 해결가능하다.
Webpack.config에서 proxy를 서버로 이어주면 된다.
devServer: {
historyApiFallback: true,
port: 3090,
devMiddleware: { publicPath: '/dist/' },
static: { directory: path.resolve(__dirname) },
proxy: {
'/api/': {
target: 'http://localhost:3095',
changeOrigin: true,
},
},
},
728x90
'Web > React' 카테고리의 다른 글
React -Chartjs (0) | 2022.06.29 |
---|---|
React - Axios (0) | 2022.06.28 |
React - 회원가입 (0) | 2022.06.25 |
React - REACT QUERY + 우아한테크세미나 정리 (0) | 2022.06.25 |
React - Emotion (0) | 2022.06.25 |