post - Simple request from mobile client to Meteor server -
using browser client interact db in meteor trivial. however, having trouble retrieving data (non-js) mobile client. in usual django or php server, simple or post request client , respond whatever want server, meteor works different; haven´t seen example of how respond server client.
if it's of interest, mobile client uses c#.
edit: question. can achieve ironrouter or somehow using ddp? read ddp posing option.
you can use middleware purpose:
webapp.connecthandlers.stack.splice(0, 0, { route: '/api/endpoint', handle: function(req, res, next) { res.writehead(200, {'content-type': 'application/json'}); res.end('{"success": true}'); }, });
in handle function, req
, res
usual node.js requests , response objects , can handle them in same way in typical node.js application. next
function may call in case decide reason don't want respond request, , let meteor propagate request further through stack.
Comments
Post a Comment