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
{ "proxy": "https://apis.data.go.kr/" }
이렇게 설정을 해주게 되면 API 서버와 동일한 도메인이 됨으로서 CORS 정책 해결 및 Access-Control-Allow-Origin의 허용을 받을 수 있음
npm install http-proxy-middleware --save
const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = function(app) { app.use( '/api', createProxyMiddleware({ target: 'http://localhost:8080', changeOrigin: true, }) ); };
import React, { useEffect } from 'react'; import axios from 'axios'; function LandingPage() { useEffect(() => { axios.get('api/hello') .then(response => console.log(response.data)) }, []) return ( <div> LandingPage </div> ) } export default LandingPage;
The text was updated successfully, but these errors were encountered:
yunyoung1819
No branches or pull requests
상황
원인
해결
이렇게 설정을 해주게 되면 API 서버와 동일한 도메인이 됨으로서 CORS 정책 해결 및 Access-Control-Allow-Origin의 허용을 받을 수 있음
참고
The text was updated successfully, but these errors were encountered: