File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,13 @@ Echoサーバでは `req.pipe(res);` という形でリクエストをそのま
36
36
37
37
それぞれの処理を_middleware_としてファイルを分けて実装し、` app.use(middleware) ` で処理を追加しています。
38
38
39
- [ import errorHandler.js] ( ../../src/connect/errorHandler.js )
40
39
41
40
[ import nosniff.js] ( ../../src/connect/nosniff.js )
42
41
43
42
[ import hello.js] ( ../../src/connect/hello.js )
44
43
44
+ [ import errorHandler.js] ( ../../src/connect/errorHandler.js )
45
+
45
46
[ import connect-example.js] ( ../../src/connect/connect-example.js )
46
47
47
48
基本的にどの_middleware_も` app.use(middleware) ` という形で拡張でき、
@@ -66,9 +67,9 @@ Connectが登録された_middleware_をどう処理するかというと、
66
67
67
68
上記の例だと以下の順番で_middleware_が呼び出されることになります。
68
69
69
- - errorHandler
70
70
- nosniff
71
71
- hello
72
+ - errorHandler
72
73
73
74
エラーハンドリングの_middleware_は処理中にエラーが起きた時のみ呼ばれます。
74
75
You can’t perform that action at this time.
0 commit comments