Update webServer.js

This commit is contained in:
Luis Fernando Molina committed 2020-04-16 21:44:37 +02:00
1 parent 85ef7a8f3f
commit 1e325a47d9
1 file changed
+4 -6
+4 -6
View File
@@ -172,8 +172,6 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
}
case 'Webhook': {
console.log('ARRIVED')
console.log(JSON.stringify(requestParameters))
switch (requestParameters[2]) {
case 'Fetch-Messages': {
console.log('Fetch-Messages')
@@ -182,12 +180,12 @@ exports.newWebServer = function newWebServer(EVENTS_SERVER) {
break
}
case 'New-Message': {
console.log('New-Message')
getBody(processRequest)
function processRequest(body) {
console.log(body)
webhookMessages.push(body)
function processRequest(messageReceived) {
let timestamp = (new Date()).valueOf()
webhookMessages.push([timestamp,messageReceived])
respondWithContent(JSON.stringify(global.DEFAULT_OK_RESPONSE), response)
}
break