Last active
March 5, 2018 22:26
-
-
Save mpicciolli/5036fb800c38ed447098db41afc494f9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Middleware, NestMiddleware, ExpressMiddleware } from '@nestjs/common'; | |
import { BotConnector } from '../common/common.bot.connector'; | |
@Middleware() | |
export class MessagesMiddleware implements NestMiddleware { | |
connectorListener; | |
constructor(private readonly botConnector: BotConnector) { | |
this.connectorListener = botConnector.connector.listen(); | |
} | |
resolve(...args: any[]): ExpressMiddleware { | |
return (req, res, next) => { | |
this.connectorListener(req, res); | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment