13
12

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.

Express3.xから4に変更するとき

Posted at

だいたいはここに書いてはあるんだけど、ざっくりと言うと

  • 3.xでuse(express.*)と書いてあるところはexpress.staticを除いて、新たにモジュールを入れてrequireしてそれをuseするコードに書き換える(bodyParser,cookieParser,favicon,session)

  • app.use(app.router)の部分を投げ捨てる

  • app.configure()は使えないので適宜等価なコードに書き換える

  • connect-redisを使っている場合はexpress4をサポートしている最新バージョンに上げる(packages.jsonの書き方次第では、おそらくnpm updateで芋づる式にあがると思うけど)

  • connect-redisのUsage通りにコードを書き換える

13
12
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
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?