Last active
February 28, 2025 09:46
-
-
Save ozjimbob/5836eeae0a2c50524266600031009be3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* GET home page which lists blog posts. */ | |
router.get('/', (req, res, next) => { | |
console.log("Waiting") | |
// With awaits - crash, not allowed | |
// Without awaits - functions are called, but I never get my data back because it doesn't wait for the answer before proceeding... | |
const [data,links]= await Promise.all([ | |
await postsfn(), | |
await linksfn() | |
]) | |
console.log(data); | |
console.log(links); | |
res.render('index', {data:data,sitename:config.sitename, links:links}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment