import { JsonController , Get , QueryParam } from 'routing-controllers' ; import { Service } from 'typedi' ; import { checkSignature } from '../../util' ; @ Service ( ) @ JsonController ( '/messages' ) export class MessageController { @ Get ( '/signature' ) signature ( @ QueryParam ( 'signature' ) signature , @ QueryParam ( 'timestamp' ) timestamp , @ QueryParam ( 'nonce' ) nonce , @ QueryParam ( 'echostr' ) echostr ) { return checkSignature ( signature , timestamp , nonce ) ? echostr : null ; } }