diff --git a/lib/server-app.js b/lib/server-app.js index 4a55f108..ac8e09ea 100644 --- a/lib/server-app.js +++ b/lib/server-app.js @@ -30,11 +30,18 @@ module.exports = function loopbackExpress() { * * @param {function} factory The factory function creating a middleware handler. * Typically a result of `require()` call, e.g. `require('compression')`. - * @param {Array|*} config The configuration. Either an array of arguments - * to pass to the factory function, or the value of the first argument - * when the factory expects a single argument only. + * @options {Object} config The configuration. + * @property {String} phase The phase to register the middelware in. + * @property {Boolean} [enabled] Whether the middleware is enabled. + * Default: `true`. + * @property {Array|*} [params] The arguments to pass to the factory + * function. Either an array of arguments, + * or the value of the first argument when the factory expects + * a single argument only. * * @returns {object} this (fluent API) + * + * @header app.middlewareFromConfig(factory, config) */ proto.middlewareFromConfig = function(factory, config) { assert(typeof factory === 'function', '"factory" must be a function'); @@ -87,6 +94,8 @@ proto.middlewareFromConfig = function(factory, config) { * names to add. * * @returns {object} this (fluent API) + * + * @header app.defineMiddlewarePhases(nameOrArray) */ proto.defineMiddlewarePhases = function(nameOrArray) { this.lazyrouter(); @@ -107,6 +116,8 @@ proto.defineMiddlewarePhases = function(nameOrArray) { * `function(req, res, next)` or * `function(err, req, res, next)` * @returns {object} this (fluent API) + * + * @header app.middleware(name, handler) */ proto.middleware = function(name, handler) { this.lazyrouter();