Adds a new middleware configuration to an existing LoopBack application.
If you're adding third-party middleware, you must install the middleware package for your application with npm install -save <middleware-package>.
You can optionally provide the name of the middleware function to create as an argument. If you do, the tool will use that as the default when it prompts for the name.
Name of the new middleware function. If you supplied a name on the command-line, just hit Enter to use it.
Phase when the middleware function will be invoked. You can select any of the predefined phases or a custom phase. For more information about middleware phases, see Defining middleware.
Sub-phase when the middleware function will be invoked (before, regular, or after).
Paths (routes) that will invoke the middleware function.
Configuration parameters in JSON format.
Here is an example to add a middleware to an existing phase.
Enter an empty path name when done.
Middleware m1 is added to phase routes.
The following is an example to add a middleware to a custom phase.
Middleware m2 is added to phase p1.