我看到 /logout URL 的错误消息“Cannot GET /logout”,但从文档看来,该链接应该自动注册为路由。我的代码目前非常基本,如下所示:
var express = require("express");
var stormpath = require('express-stormpath');
var app = express();
var port = 1337;
app.use(stormpath.init(app, {
apiKey: {
id: '<>',
secret: '<>'
},
application: {
href: "<>"
},
website: true
}));
app.get("/", stormpath.loginRequired, function(req, res) {
res.send("Hello Node.js and Express.");
});
app.on('stormpath.ready', function() {
console.log('Stormpath Ready!');
});
console.log("Web application opened.");
app.listen(port);
任何帮助深表感谢。