File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,22 @@ let server = new FastBootAppServer({
103103server .start ();
104104```
105105
106+ ## Pre and Post FastBoot middleware hooks
107+
108+ If you need something less than a custom server and just want to run some middleware
109+ before or after FastBoot runs, the server provides hooks for you to do so:
110+
111+ ``` js
112+ // Custom Middlewares
113+ function modifyRequest (req , res , next ) { /* do pre-fastboot stuff to `req` */ };
114+ function handleErrors (err , req , res , next ) { /* do error recovery stuff */ };
115+
116+ const server = FastBootAppServer ({
117+ preFastbootMiddlewares : function (app ) { app .use (modifyRequest); },
118+ postFastbootMiddlewares : function (app ) { app .use (handleErrors); }
119+ })
120+ ```
121+
106122## Downloaders
107123
108124You can point the app server at a static path that you manage, but that
You can’t perform that action at this time.
0 commit comments