var router = express.Router();
router.get("/", function(req, res) {
res.send("<h1>Hello World</h1>");
});
app.use("/home", router)
The above code creates a new routing object that returns Hello World when the access root route (/) is specified. The route is then loaded in the / home path, that is, accessing / home returns Hello World.
but if you add a route
router.get("/a", function(req, res) {
res.send("<h1>Hello pojia</h1>");
});
there are two routes"/","/ a"at this time. What will be output if you visit"/ home" at this time? Why?