문제

Since I'm not intimately familiar with Express, can anybody tell me why v4.0.0 doesn't include --sessions as a command?

When I use version 3.4.8 this command is supported, but when I grab the newest version, I run into 2 issues:

  1. The Express.cmd isn't generated (I'm running on Win8.1 x64) - Therefore I had to run npm install express-generator
  2. No included support for the --sessions command

I might also be missing something and this was an intentional separation done by the Express team?

도움이 되었습니까?

해결책

Connect middleware is no longer bundled with express. You have to install the session middleware yourself in express 4.x. For a decent guide on updating see this post.

%npm install express-session

then

var session = require ('express-session');

and replace

app.use(express.session());

with

app.use(session({secret: 'keyboard cat', cookie: { maxAge: 100000 }}));
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top