去除express.js 3.5中报connect.multipart() will be removed in connect 3.0的警告
2014-04-21 14:34
369 查看
1 $ node app.js
2 connect.multipart() will be removed in connect 3.0
3 visit
https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
4 connect.limit() will be removed in connect 3.0
根据提示,到connect 3.0的WIKI,找到了答案.如果在3.0中使用
虽然警告没无大碍,但既然使用最新版,就跟新版的规则来吧.由于Express使用了connect中间件,参照connect WIKI给的解决方案,用json和urlencoded替换bodyParser.即是把如下的。
1 app.use(express.bodyParser());
替换为
1 app.use(express.urlencoded());
2 app.use(express.json());
并且,安装模块
1 app.use(express.multipart());
替换为
1 app.use(require('connect-multiparty')());
即可。
2 connect.multipart() will be removed in connect 3.0
3 visit
https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
4 connect.limit() will be removed in connect 3.0
根据提示,到connect 3.0的WIKI,找到了答案.如果在3.0中使用
connect.bodyParser()会在程序启动时收到弃用警告,但并不影响程序的正常工作.
虽然警告没无大碍,但既然使用最新版,就跟新版的规则来吧.由于Express使用了connect中间件,参照connect WIKI给的解决方案,用json和urlencoded替换bodyParser.即是把如下的。
1 app.use(express.bodyParser());
替换为
1 app.use(express.urlencoded());
2 app.use(express.json());
并且,安装模块
npm install --save connect-multiparty,把
1 app.use(express.multipart());
替换为
1 app.use(require('connect-multiparty')());
即可。
相关文章推荐
- 去除express.js 3.5中报connect.multipart() will be removed in connect 3.0的警告
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: u
- 解决mysql_connect(): The mysql extension is deprecated and will beremoved in the future: use mysqli or
- phpmyadmin,解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in t
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- git警告warning: CRLF will be replaced by LF in iris/js/list.js.
- mysql_connect(): The mysql extension is deprecated and will be removed in the future
- php 报: 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the f
- 解决PHP中Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the futu
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- Deprecated: mysql_connect(): The mysqlextension is deprecated and will be removed in the future: use
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in
- Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: us
- 解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: