Module: Middlewares/Loader

Middleware loader

This module loads middlewares as they are set in the current configuration

Source:

Methods

(static) loadMiddlewares(config, service) → {Promise.<Object>}

Pull all middleware names from config, retrieve the related modules, instanciate every middleware and register them in the service

Parameters:
Name Type Description
config Object

Current configuration

service Object

Service reference

Source:
Returns:

Service reference

Type
Promise.<Object>

(inner) registerMiddleware(service, middleware) → {Object}

Register a middleware

Parameters:
Name Type Description
service Object

service reference

middleware function

Middleware function

Source:
Returns:

Service reference

Type
Object