how to use multiple app.get in node js to render different webpages on different calls

11 Views Asked by At

i have been trying to use noje.js to render webpages by using app.get syntax

but it is only working for "/" not for anyother

app.get("/", function(req, res) {
  res.render("home",{startingContent:homeStartingContent})
});

app.get("/about ", function(req, res) {
  res.render("about",{ aboutContent:aboutContent})
});

app.get("/contact ", function(req, res) {
  res.render("contact",{ aboutContact:contactContent})
});

the error that i keep getting is --Cannot GET /about

i tried using only a single app.get but it only works for "/"

0

There are 0 best solutions below