Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save inlightmedia/b756984b871465feddbd3ed014572a21 to your computer and use it in GitHub Desktop.
Save inlightmedia/b756984b871465feddbd3ed014572a21 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