Skip to content

Instantly share code, notes, and snippets.

@paulbreslin
Last active July 3, 2017 16:29
Show Gist options
  • Save paulbreslin/09a1dfc52e3471c49d13ee7c785026c7 to your computer and use it in GitHub Desktop.
Save paulbreslin/09a1dfc52e3471c49d13ee7c785026c7 to your computer and use it in GitHub Desktop.
router.post('/words', async (req, res) => {
const {userId, word} = req.body;
const definition = await fetch(`https://words-api.com/definition/${word}`).json();
const wordData = {
word,
definition
};
db.ref(`words/${userId}`).set({wordData};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment