Merge pull request #138 from strongloop/feature/fix-middleware-events-examples

Replace `on` with `once` in middleware examples
This commit is contained in:
Miroslav Bajtoš 2014-01-13 23:13:34 -08:00
commit d745d1a924
1 changed files with 3 additions and 3 deletions

View File

@ -451,7 +451,7 @@ function tryReadConfig(cwd, fileName) {
*
* Usage:
* ```js
* app.on('middleware:preprocessors', function() {
* app.once('middleware:preprocessors', function() {
* app.use(loopback.limit('5.5mb'))
* });
* ```
@ -461,7 +461,7 @@ function tryReadConfig(cwd, fileName) {
*
* Usage:
* ```js
* app.on('middleware:handlers', function() {
* app.once('middleware:handlers', function() {
* app.use('/admin', adminExpressApp);
* app.use('/custom', function(req, res, next) {
* res.send(200, { url: req.url });
@ -483,7 +483,7 @@ function tryReadConfig(cwd, fileName) {
* ```js
* var bunyan = require('bunyan');
* var log = bunyan.createLogger({name: "myapp"});
* app.on('middleware:error-loggers', function() {
* app.once('middleware:error-loggers', function() {
* app.use(function(err, req, res, next) {
* log.error(err);
* next(err);