Express renders the same template for different routes

router.get("/",function (req,res,next) {
    res.render("index");
})

router.get("/a",function (req,res,next) {
    // axios 
})

the first route is a path request to render index.html in index.html, and request / a to node after html gets some value. Request the server to get the data in / a, so how to render the data to index.html.

May.19,2022

template engine ejs

Menu