Skip to content

Instantly share code, notes, and snippets.

@fernandocamargo
Created May 12, 2020 10:56
Show Gist options
  • Save fernandocamargo/dfa1b6ef8249a4d43337df8ad58b38f8 to your computer and use it in GitHub Desktop.
Save fernandocamargo/dfa1b6ef8249a4d43337df8ad58b38f8 to your computer and use it in GitHub Desktop.
import axios from 'axios';
export default axios.create({
baseURL: 'https://api.expertlead.de/v.1.0/',
timeout: 1000,
headers: {
'token': '<YOUR_TOKEN>'
}
});
import useService from 'service';
export default () => {
const [fetch] = useService();
return (
<div>
<button onClick={fetch}>Fetch data</button>
</div>
);
};
import client from 'client';
export default () => client.get('/some-endpoint');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment