After node.js calls the router module, the access address reports an error Cannot Get/login?.

problem description

No error was reported after running server.js using app.use mount route"/ login", in server.js, but an error was reported when accessing the route. Cannot Get/login, still doesn"t know what the problem is. This problem will not occur if you use app.post.

related codes

. / routes/login/index.js

var express = require("express");
const router = express.Router();
    router.get("/login",function(req,res){
        res.send("OK");
    });
module.exports = router;

server.js

var express = require("express");
var app = express();
var loginRoute = require("./routes/login/index.js");
app.use("/login",loginRoute);

there is no error reported on the server. I don"t know what the problem is. According to reason should be able to return to OK, please help to have a look, thank you!

Apr.20,2021

this is / login/login , change it to

router.get('/',function(req,res){
        res.send("OK");
    });

like you said upstairs, you wrapped an extra layer.

Menu