A function that will be called the moment the application tries to mount the middleware.
const myMiddleware = controller((app) => {
const responsesBuilder = app.get<ResponsesBuilder>('responsesBuilder');
return (_, res) => {
responsesBuilder.json({ res, data: { hello: 'world' } });
};
});
// ...
container.use(myMiddleware);
container.mount('/charo', myMiddleware);
Generated using TypeDoc
Generates a middleware for the application container to mount.