Skip to content

Instantly share code, notes, and snippets.

@jineeshjohn
Created January 6, 2020 12:01
Show Gist options
  • Save jineeshjohn/ec00b637bf3e46a036f775a501d7c9b1 to your computer and use it in GitHub Desktop.
Save jineeshjohn/ec00b637bf3e46a036f775a501d7c9b1 to your computer and use it in GitHub Desktop.
How to create a proxy using react create app
//step 1: Inside package.json add proxy key
// eg: "proxy": "http://jsonplaceholder.typicode.com"
//step 2: sample program to retrive from jsonplaceholder
(async()=>{
const apiData = await fetch('/users');
const json = await apiData.json();
console.log("JJJ:", json);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment