Page Contents

Home > @loopback/express > registerExpressMiddleware

registerExpressMiddleware() function

Bind a Express middleware to the given context

Signature:

export declare function registerExpressMiddleware<CFG>(ctx: Context, middlewareFactory: ExpressMiddlewareFactory<CFG>, middlewareConfig?: CFG, options?: MiddlewareBindingOptions): Binding<Middleware>;

Parameters

Parameter Type Description
ctx Context Context object
middlewareFactory ExpressMiddlewareFactory<CFG> Middleware module name or factory function
middlewareConfig CFG Middleware config
options MiddlewareBindingOptions Options for registration

Returns:

Binding<Middleware>