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
Release: 2016-08-08 08:50:25
Original
841 people have browsed it
<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>
Copy after login

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?

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template