Skip to content

Instantly share code, notes, and snippets.

@paulbreslin
Last active March 27, 2018 03:25
Show Gist options
  • Save paulbreslin/57c1c077c6d6d001e46af27307eb1fba to your computer and use it in GitHub Desktop.
Save paulbreslin/57c1c077c6d6d001e46af27307eb1fba to your computer and use it in GitHub Desktop.
// API
router.get('/words', async (req, res) => {
const wordsRef = db.ref(`words`).once('value');
const usersRef = db.ref(`users`).once('value');
const values = await Promise.all([wordsRef, usersRef]);
const wordsVal = values[0].val();
const userVal = values[1].val();
res.sendStatus(200);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment