Skip to content

Commit

Permalink
fix(connect): エラーハンドリングの呼び出し順にについてを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Sep 17, 2015
1 parent 9e0acaf commit f33eb8f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ja/connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,13 @@ Echoサーバでは `req.pipe(res);` という形でリクエストをそのま

それぞれの処理を_middleware_としてファイルを分けて実装し、`app.use(middleware)`で処理を追加しています。

[import errorHandler.js](../../src/connect/errorHandler.js)

[import nosniff.js](../../src/connect/nosniff.js)

[import hello.js](../../src/connect/hello.js)

[import errorHandler.js](../../src/connect/errorHandler.js)

[import connect-example.js](../../src/connect/connect-example.js)

基本的にどの_middleware_も`app.use(middleware)`という形で拡張でき、
Expand All @@ -66,9 +67,9 @@ Connectが登録された_middleware_をどう処理するかというと、

上記の例だと以下の順番で_middleware_が呼び出されることになります。

- errorHandler
- nosniff
- hello
- errorHandler

エラーハンドリングの_middleware_は処理中にエラーが起きた時のみ呼ばれます。

Expand Down

0 comments on commit f33eb8f

Please sign in to comment.