Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fetch('http://localhost:4000', {
- headers: {
- 'Content-Type': 'application/json',
- "Access-Control-Allow-Origin": "*"
- },
- })
- .catch(err => console.log(err))
- .then(data => data.json())
- .then(json => console.log(json))
- /*
- Promise { <state>: "pending" }
- Object { content: "<h1>Hello World</h1>" }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement