Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- vaadin
- 공정능력
- SSL
- es6
- hadoop
- R
- window
- tomcat
- Python
- Eclipse
- Express
- GIT
- plugin
- table
- mybatis
- IntelliJ
- Kotlin
- Sqoop
- 보조정렬
- Android
- MSSQL
- SPC
- JavaScript
- NPM
- SQL
- xPlatform
- react
- Spring
- mapreduce
- Java
Archives
- Today
- Total
DBILITY
react cors proxy 본문
반응형
axios로 외부에서 dummy 데이터를 불러와 테스트 중 cors오류가 발생했다.
근 1년만인가? 당연한 일이다. 그런데 생각이 나지 않는다.ㅎㅎ
package.json에 proxy를 추가하면 된다.
dummyjon에 연결하려면 다음과 같이
"proxy": "https://dummyjson.com"
axios에서 호출하는 url에 사이트상의 경로만 지정하면 된다.
http-proxy-middleware를 사용해도 된다.
반응형
'front-end & ui > react' 카테고리의 다른 글
react redux redux-toolkit (0) | 2023.04.13 |
---|---|
react styled component (0) | 2023.04.12 |
react v18 UseTransition, useDeferredValue hook (0) | 2022.06.07 |
react file upload, dropzone (0) | 2022.04.13 |
react To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. (0) | 2022.04.05 |
Comments