How to get rid of Connect 3.0 deprecation alert?

后端 未结 3 1236
梦毁少年i
梦毁少年i 2020-12-04 14:10

I\'m a node.js developer who creates web apps using express.js. By now, my problem is:

Whenever I create an app on my computer, npm install its stuff and run it (wit

3条回答
  •  星月不相逢
    2020-12-04 14:57

    i'm responsible for this deprecation notice. did you read the wiki? https://github.com/senchalabs/connect/wiki/Connect-3.0

    step 1: use each parser directly instead of app.use(express.bodyParser());

    app.use(express.json());
    app.use(express.urlencoded());
    

    step 2: use a different multipart parser, for e.g: connect-multiparty can be used

    app.use(require('connect-multiparty')())
    

    work on connect 3 and express 4 hasn't begun yet because node 0.12 is taking a while to be released. there's nothing to update, yet.

提交回复
热议问题