Skip to content

Instantly share code, notes, and snippets.

Last active May 23, 2018 16:01
What would you like to do?
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