Function middleware

Generates a middleware for the application container to mount.

  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);