node.js - grunt task using node http gets "no app" response from node app in heroku -
I run raucous works that ping my node app. Developing. The locally running node app answers accordingly. When I deploy on his lock and work there, I get an html page similar to "Heroku App".
Curl works: 'myapp.herokuapp.com and some = stuff' so I know that the posted node app is working. The way in which I am doing the parameterization of the http call, what is wrong in it?
grunt.registerTask ("testGet", function () {var done = this.async (); var option = {host: 'http://myapp.herokuapp.com', / / Host: "127.0.0.1", // port: 8000, path: "/myResource?"+qs.stringify({user_id=, device: 0}), method:" GET "}; var req = http.request (Option, function) (res.on ('data', function (chuck) {grunt.log.write (chuck + "\ n");}) done ()});) ('error', function (Mistake) {console.log (get 'with problem:' + err.message);}); Req.end ();}) / code> I have tried many things: moving the curie parameter to the body, making hard coding, hard coding to Heroco port, adding different headers but pings Does not even appear in its logs.
The strange thing is, once it is deployed once, works once, not after it, and not after a deployment again.
host: 'http://myapp.herokuapp.com', Must be: Host: 'myapp.herokuapp.com',
Comments
Post a Comment