Share : Answer for rendering two pages
first of all, I looked at your code you have a timeout of 5 seconds to render sample.ejs the second one doesn't have timeout render ask you self which one first you need to render and what is the second one you need to start render after first one and also don't forget to use next() also give the other render timeout you also using get what are you doing? sometimes conditions may help you. what is the frontEnd is doing or sending to the backend?
app.get('/example',(req,res,next)=>{
setTimeout(()=>{res.render('anotherpage.ejs'), res.render('sample.ejs')}, 5000);
next()
})