Skip to content

Instantly share code, notes, and snippets.

@chrisoverstreet
Last active May 23, 2018 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisoverstreet/63ed8ce858d30cde3d837ad65a13f509 to your computer and use it in GitHub Desktop.
Save chrisoverstreet/63ed8ce858d30cde3d837ad65a13f509 to your computer and use it in GitHub Desktop.
Cosmic Blog tutorial - Fetch post
const fetchPost = slug => fetch(`${API_URL}/post/${slug}`)
.then(res => res.json())
.then(json => console.log(json));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment