You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dispatcher/index.md
+37-3
Original file line number
Diff line number
Diff line change
@@ -106,10 +106,10 @@ container.add(
106
106
)
107
107
);
108
108
```
109
-
## Set dispatcher
109
+
## <aname="set-dispatcher"></a> Set dispatcher
110
110
111
-
Fano Framework allows application to change dispatcher implementation to use by
112
-
overriding `buildDispatcher()` method of `TBasicServiceProvider` class. In this method implementation, you must returns
111
+
Fano Framework allows application to change dispatcher implementation to use, by
112
+
overriding protected `buildDispatcher()` method of `TBasicServiceProvider` class. In this method implementation, you must returns
113
113
instance of dispatcher.
114
114
115
115
```
@@ -119,6 +119,40 @@ begin
119
119
end;
120
120
```
121
121
122
+
If you use Fano CLI to [scaffold your web application project](/scaffolding-with-fano-cli), you can declared `buildDispatcher()` in `bootstrap.pas` file as shown in following example.
When you attach middleware to a route but middleware is not being called, make sure you use [dispatcher implementation which supports middleware](/dispatcher#set-dispatcher). Middleware support is not enabled by default.
370
+
365
371
## Performance consideration
366
372
367
373
Using middleware adds overhead as request must go multiple execution points before reaching actual request handler. Also, you need to aware that each middleware will call next middleware recursively so you should limit number of middlewares in use.
0 commit comments