Home > @loopback/express express package
The Express integration package for loopback-next.
This module introduces Koa style cascading middleware that leverage
async/await. It also enables the ability to plug in existing Express middleware as LoopBack middleware or interceptors so that they can be used at sequence/action, global interceptor, and local interceptor tiers.
This module also serves as a standalone extension to Express to provide extensibility and composability for large-scale Express applications by leveraging LoopBack’s Dependency Injection and Extension Point/Extension pattern.
BaseMiddlewareRegistry Base Context that provides APIs to register middleware
ExpressApplication A LoopBack application with Express server
ExpressMiddlewareInterceptorProvider Base class for MiddlewareInterceptor provider classes
ExpressServer An Express server that provides middleware composition and injection
InvokeMiddlewareProvider Extension point for middleware to be run as part of the sequence actions
MiddlewareChain An interceptor chain of middleware. This represents a list of cascading middleware functions to be executed by the order of
MiddlewareContext A per-request Context for middleware to combine an IoC container with handler context (request, response, etc.).
MiddlewareView Watch middleware binding keys for the given context and sort them by group
asMiddleware(options) Template function for middleware bindings
buildName(middlewareFactory, providedName, suffix) Build a name for the middleware
createInterceptor(middlewareFactory, middlewareConfig) Create an interceptor function from express middleware.
createMiddleware(middlewareFactory, middlewareConfig) An adapter function to create a LoopBack middleware from Express middleware factory function and configuration object.
createMiddlewareBinding(middlewareProviderClass, options) Create a binding for the middleware provider class
createMiddlewareInterceptorBinding(middlewareProviderClass, options) Create a binding for the middleware based interceptor
defineInterceptorProvider(middlewareFactory, defaultMiddlewareConfig, options) Define a provider class that wraps the middleware as an interceptor
executeExpressRequestHandler(handler, request, response) Execute an Express-style callback-based request handler.
invokeExpressMiddleware(middlewareCtx, handlers) Invoke a list of Express middleware handler functions
invokeMiddleware(middlewareCtx, options) Discover and invoke registered middleware in a chain for the given extension point.
registerExpressMiddleware(ctx, middlewareFactory, middlewareConfig, options) Bind a Express middleware to the given context
registerExpressMiddlewareInterceptor(ctx, middlewareFactory, middlewareConfig, options) Bind a middleware interceptor to the given context
registerMiddleware(ctx, middleware, options) Bind the middleware function or provider class to the context
sortListOfGroups(orderedGroups) Sort the groups by their relative order
toExpressMiddleware(ctx) An adapter function to create an Express middleware handler to discover and invoke registered LoopBack-style middleware in the context.
toInterceptor(firstHandler, additionalHandlers) Wrap an express middleware handler function as an interceptor
toMiddleware(firstHandler, additionalHandlers) An adapter function to create a LoopBack middleware that invokes the list of Express middleware handler functions in the order of their positions