13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

最新Express.jsでのWarning解消

Posted at

最新のExpress.js (2013-10-27現在でv3.4.3)を使うと以下のwarningが出ることに気がついた

connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0

まぁ、参照されているWikiに書かれている通りなのだが、Express.jsの下で使っている Connectが3.0で過去非互換な変更を入れるらしく、2.xシリーズでも警告を出すようになった。ヒストリーをみると10/18の2.9.2から。

解決策は bodyParser() の代わりに json()とurlencoded()を直接呼ぶこと。具体的には

app.use(express.bodyParser());

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

に置き換えればOK。

13
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
13
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?