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 @@ -88,6 +88,8 @@ Connectが登録された_middleware_をどう処理するかというと、
88
88
89
89
つまり、処理的には以下のようにstackを先頭から一個づつ取り出して、処理していくという方法が取られています。
90
90
91
+ Connectの行っている処理を抽象的なコードで書くと以下のような形となっています。
92
+
91
93
``` js
92
94
let req = " ..." ,
93
95
res = " ..." ;
@@ -103,12 +105,11 @@ next();// 初回
103
105
このような_middleware_を繋げた形を_middleware stack_と呼ぶことがあります。
104
106
105
107
_ middleware stack_で構成されるHTTPサーバとして、PythonのWSGI MiddlewareやRubyのRackなどがあります。
106
-
107
108
ConnectはRackと同じく` use ` で_middleware_を指定することからも分かりますが、
108
109
Rackを参考にして実装されています。
109
110
110
111
- [ Ruby - Rack解説 - Rackの構造とRack DSL - Qiita] ( http://qiita.com/higuma/items/838f4f58bc4a0645950a#2-5 " Ruby - Rack解説 - Rackの構造とRack DSL - Qiita ")
111
112
112
- 次に、この_middleware stack_の具体的な実装を書きながら見て行きましょう 。
113
+ 次は、先ほど抽象的なコードとなっていたものを、具体的な実装にしていきます 。
113
114
114
115
## 実装してみよう
You can’t perform that action at this time.
0 commit comments