Hook into the various phases of a LoopBack application.
This module is in Active LTS mode, new features are no longer accepted. (See Module Long Term Support Policy below.) LoopBack 3 users looking for new features are encouraged to upgrade to LoopBack 4. Refer to loopback-next#1849 for more information on how to upgrade.
npm install loopback-phase
var PhaseList = require('loopback-phase').PhaseList;
var phases = new PhaseList();
phases.add('first');
phases.add('second');
phases.add('third');
var first = phases.find('first');
var second = phases.find('second');
first.use(function(ctx, cb) {
console.log('this is the first phase!');
cb();
});
second.use(function(ctx, cb) {
console.log('this is the second phase!');
cb();
});
phases.run(ctx);See API docs for complete API reference.
MIT.
This module adopts the Module Long Term Support (LTS) policy, with the following End Of Life (EOL) dates:
| Version | Status | Published | EOL |
|---|---|---|---|
| 3.x | Active LTS | Dec 2016 | Dec 2019 |
| 1.x | Maintenance LTS | Oct 2014 | Apr 2019 |
Learn more about our LTS plan in the docs.