code: function middleware2() {
  	return function (handler) {
  
  		return function mw2(ctx) {
  			broker.logger.info(chalk.magenta("mw2 before-promise", ctx.action.name));
  			return new broker.Promise(resolve => {
  				setTimeout(() => {
  					broker.logger.info(chalk.magenta("mw2 before", ctx.action.name));
  					//resolve("data from mw2");
  					resolve();
  				}, 300);
  			}).then(() => {
  				return handler(ctx);
  			}).then(res => {
  				broker.logger.info(chalk.magenta("mw2 after", ctx.action.name));
  				return res;
  			});
  		};
  	};
  }
docs: Promise example