Home >Backend Development >PHP Tutorial >After referencing connect in node, using its own middleware will always report an error.

After referencing connect in node, using its own middleware will always report an error.

WBOY
WBOYOriginal
2016-08-08 08:50:25838browse
<code>    var connect = require('connect');
    var app = connect()
        .use(connect.cookieParser())
        .use(function(req,res){
        console.log(req.cookie);
        console.log(req.signedCookies);
    }).listen(3000);</code>

Tips: connect.cookieParser is not a function;
It will also prompt when using bodyParser.
It is said online that it is separated from connect. You need to npm install cookieParser again.
Is bodyParser also needed? All the intermediate Do you need all the pieces?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn