import { AzureFunction , Context , HttpRequest } from "@azure/functions" ; const httpTrigger = async function ( context , req ) : Promise < void > { context . log ( 'HTTP trigger function processed a request.' ) ; const validationToken = ( req . query . validationToken || ( req . body && req . body . validationToken ) ) ; if ( validationToken ) { context . log ( validationToken ) ; context . res = { body : ( req . query . validationToken || req . body . validationToken ) } ; } else { if ( req . body . value . length > 0 ) { context . log ( req . body . value ) ; context . res = { status : 200 } ; context . bindings . signalR = [ { "target" : "newMessage" , "arguments" : [ req . body ] } ] ; } } } ; export default httpTrigger ;