在我的公用文件夹我有index.html文件和我的路由处理程序是这样的如何删除nodejs中index.html的偏好?
router.get('/', function (req, res, next) {
// res.send('index.html');
if (req.user)
res.redirect('home');
else
res.redirect('login');
});
正如你所看到的,我已经注释掉index.html文件的服务,但仍的NodeJS服务索引.html从公共目录而不是重定向到home或登录。 但是,如果我删除/重命名index.html文件,那么它工作正常。
那么我怎样才能配置nodejs,以便它调用路由处理程序,而不是请求的服务器索引文件?