App.js :
import React from 'react';
import './App.css';
class App extends React.Component {
state = {
character : {}
};
componentDidMount() {
fetch("https://jobs.github.com/positions.json?description=basf")
.then(data => console.log(data));
console.log("Hello World");
}
render() {
return (
<div className="App">
<h2>Hello World</h2>
</div>
);
}
}
export default App;
Error Message -
Access to fetch at 'https://jobs.github.com/positions.json?description=basf' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Failed to Fetch
Can you please provide me how to get past this issue and get required data. I am using Github Jobs API and its showing this message.