在MeanJS
,在用户的loggedIn,我们刷新页面,在core.server.controller.js
将发送用户凭据到index.html
登录MeanJS API
exports.renderIndex = function (req, res) {
res.render('modules/core/server/views/index', {
user: req.user || null
});
};
QUES 1:为什么服务器知道是谁登录用户?即使我们已经关闭浏览器并重新打开它。
QUES 2
Lets't拨打以上的应用程序的域是本地主机:8000。
我有一个单独的网站,只有前端代码(angular
)没有后端。我们称它为localhost:3000。我可以从localhost:8000调用API并显示数据。
我也可以通过调用localhost:8000/api/auth/signin API来登录,但是在我刷新它之后,它不会将我识别为signedin用户,因为我没有服务器为我提供index.html localhost:3000 。
使本地主机:8000登录的任何伎俩工程?