kahmali / meteor-restivus

REST APIs for the Best of Us! - A Meteor 0.9+ package for building REST APIs https://atmospherejs.com/nimble/restivus
MIT License
544 stars 116 forks source link

Getting 400 Bad Request on Mup Deployed #299

Open skwerlzu opened 5 years ago

skwerlzu commented 5 years ago

Using http://apitester.com to test mup deployed and getting 400 Bad Request error.

Works fine when running test version on separate port, but gives error on deployed.

` Api.addRoute('qb/', {authRequired: false}, { get: function () { console.log(this.urlParams) return this.urlParams; }, post: function (data) {

     var body = this.bodyParams;
     if(Meteor.isDevelopment){
       body.eventNotifications = JSON.parse(body.eventNotifications);
    }
     var params = {
        urlParams: this.urlParams,
        queryParams: this.queryParams,
        bodyParams: body
     };
     qb_handleHook(body)

     Meteor.call('testcollection.newtest', 
                 {data: params},
                        (err, res) => {
                      if (err) {
                        alert(err);
                      } else {
                        // success!
                        //console.log('return from client id array')
                        console.log(res)

                      }
                    });

  return params
}

});`