http - POST from Ruby to Meteor with Iron Router? -
i've been trying message ruby script webapp built meteorjs using post, i've been facing issues. there isn't documentation online post , method management iron router.
my ruby script:
meteoruri = uri('http://localhost:3000/newreport'); res = net::http.post_form(meteoruri, 'message' => 'hellofromruby', 'max' => '50') puts "from meteor:\t#{res}"
i don't have experience ruby. above code got online.
the routing iron router:
router.route('/newreport/:message', {where: 'server'}) .post( function(message){ meteor.call('reportinsert', {message: message}, function(error, recordid){ if (error){ alert(error.reason); } else { console.log("inserted " + recordid); } }); });
i trying make ruby make post http://localhost:3000/newreport
with message supposed string.
the function reportinsert
works, tested it. issue seems in either making post, or receiving it.
thank you!
beside using alert in server side route, don't see issues on meteor's side. might want change console.log see error getting.
Comments
Post a Comment