Last active
May 23, 2018 16:01
-
-
Save chrisoverstreet/63ed8ce858d30cde3d837ad65a13f509 to your computer and use it in GitHub Desktop.
Cosmic Blog tutorial - Fetch post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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