Nodejs Socket hang up & ECONNRESET - HTTP post request from Meteor to Node js server

前端 未结 2 458
北荒
北荒 2021-01-03 20:20

I am using a node server to handle all my push notifications services like gcm and apn.

I have 2 different servers. One is running Meteor and another is running Node

2条回答
  •  粉色の甜心
    2021-01-03 20:46

    Ok I found the issue myself here. Its in the node server code. I put return in a switch statement which is not a valid way to return a response in express, so I just removed the return from:

    Before:

    switch (callType) {
       case 'systemPushNotifications':
          return pushNotificationClass.sendPushNotificationsV2(response);
       break;
    }
    

    Now:

    switch (callType) {
       case 'systemPushNotifications':
          pushNotificationClass.sendPushNotificationsV2(response);
       break;
    }
    

    The above return was terminating the code before the: res.send("OK");

提交回复
热议问题