Cookie-parser for Express

  node.js, question
After opening http://localhost:3000 in the browser, it has been turning all the time. it does not display any information. please ask for an answer. thank you all.
 
 var express = require('express');
 var app = express();
 var cookieParser = require('cookie-parser');
 
 app.use(cookieParser);
 app.get('/',function (req,res)
 bracket
 //if the cookie in the request exists isVisit, the cookie will be output.
 //otherwise, set the cookie field isVisit and set the expiration time to 1 minute.
 if (req.cookies.isVisit) {
 console.log(req.cookies);
 Res.send ("Welcome Again");
 bracket
 else {
 res.cookie('isVisit', 1, {maxAge: 60 * 1000});
 Res.send ("Welcome to First Visit");
 bracket
 res.send('Hello');
 
 });
 
 var server = app.listen(3000,function()
 bracket
 
 
 var host = server.address().address;
 var port = server.address().port;
 
 Log ('the apprunningat://percent s: percent s',host,port);
 });

https://github.com/expressjs/ …

Yours

app.use(cookieParser)

instead

app.use(cookieParser())

… seems to be fine = =
The source code part is as follows, which should be quite easy to understand.

function cookieParser(secret, options) {
 return function cookieParser(req, res, next) {
 if (req.cookies) {
 return next();
 bracket
 
 var cookies = req.headers.cookie;
 var secrets = !  secret || Array.isArray(secret)
 ?  (secret || [])
 : [secret];
 
 req.secret = secrets[0];
 req.cookies = Object.create(null);
 req.signedCookies = Object.create(null);
 
 // no cookies
 if (!  cookies) {
 return next();
 bracket
 
 req.cookies = cookie.parse(cookies, options);
 
 // parse signed cookies
 if (secrets.length !  == 0) {
 req.signedCookies = signedCookies(req.cookies, secrets);
 req.signedCookies = JSONCookies(req.signedCookies);
 bracket
 
 // parse JSON cookies
 req.cookies = JSONCookies(req.cookies);
 
 next();
 };
 bracket