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!