结果为“无法获取/”
两个文件都在同一个文件夹中,如果我直接在app.js文件中使用路由,则它可以工作。 app.js
//ROUTING
var router = require('./index');
app.use('/*', router);
//ROUTING END
index.js
var express = require('express');
var router = new express.Router();
var user = require("./controllers/user");
var products = require("./controllers/products");
router.get("/", products.products_list);
router.get("/user/profile", user.profile);
router.get("/user/signup", user.signup_redirect);
router.get("/user/logout", user.logout_redirect);
router.post("/user/signup", user.signup_post);
router.get("/user/login",user.login_redirect);
router.post("/user/login", user.login_post);
module.exports = router