Last active
July 22, 2022 05:59
-
-
Save elijahjcobb/4d23b7dddf2901b7a0be0abcc8683da3 to your computer and use it in GitHub Desktop.
Fetch a single gist from GitHub's REST API
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 id = "<the-gist-id>"; | |
fetch(`https://api.github.com/gists/${id}`) | |
.then(res => res.json()) | |
.then(gist => { | |
const {createdAt, description} = gist; | |
console.log(`The ${description} gist was created at ${createdAt}!`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment