server-app: improve jsdoc comments
This commit is contained in:
parent
7647339675
commit
330292c7f2
|
@ -30,11 +30,18 @@ module.exports = function loopbackExpress() {
|
||||||
*
|
*
|
||||||
* @param {function} factory The factory function creating a middleware handler.
|
* @param {function} factory The factory function creating a middleware handler.
|
||||||
* Typically a result of `require()` call, e.g. `require('compression')`.
|
* Typically a result of `require()` call, e.g. `require('compression')`.
|
||||||
* @param {Array|*} config The configuration. Either an array of arguments
|
* @options {Object} config The configuration.
|
||||||
* to pass to the factory function, or the value of the first argument
|
* @property {String} phase The phase to register the middelware in.
|
||||||
* when the factory expects a single argument only.
|
* @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)
|
* @returns {object} this (fluent API)
|
||||||
|
*
|
||||||
|
* @header app.middlewareFromConfig(factory, config)
|
||||||
*/
|
*/
|
||||||
proto.middlewareFromConfig = function(factory, config) {
|
proto.middlewareFromConfig = function(factory, config) {
|
||||||
assert(typeof factory === 'function', '"factory" must be a function');
|
assert(typeof factory === 'function', '"factory" must be a function');
|
||||||
|
@ -87,6 +94,8 @@ proto.middlewareFromConfig = function(factory, config) {
|
||||||
* names to add.
|
* names to add.
|
||||||
*
|
*
|
||||||
* @returns {object} this (fluent API)
|
* @returns {object} this (fluent API)
|
||||||
|
*
|
||||||
|
* @header app.defineMiddlewarePhases(nameOrArray)
|
||||||
*/
|
*/
|
||||||
proto.defineMiddlewarePhases = function(nameOrArray) {
|
proto.defineMiddlewarePhases = function(nameOrArray) {
|
||||||
this.lazyrouter();
|
this.lazyrouter();
|
||||||
|
@ -107,6 +116,8 @@ proto.defineMiddlewarePhases = function(nameOrArray) {
|
||||||
* `function(req, res, next)` or
|
* `function(req, res, next)` or
|
||||||
* `function(err, req, res, next)`
|
* `function(err, req, res, next)`
|
||||||
* @returns {object} this (fluent API)
|
* @returns {object} this (fluent API)
|
||||||
|
*
|
||||||
|
* @header app.middleware(name, handler)
|
||||||
*/
|
*/
|
||||||
proto.middleware = function(name, handler) {
|
proto.middleware = function(name, handler) {
|
||||||
this.lazyrouter();
|
this.lazyrouter();
|
||||||
|
|
Loading…
Reference in New Issue