I think you can only start the server, create a route which is calling a 
function that make the call to your crossdomain.

var restify = require('restify');


> var server = restify.createServer({

    name:'MyApp'

});


> server.get('/hello/:name', function(req, res, next){

    // make your call here and when you got all the data then use 
> res.send() with the data

});


> server.listen(4433, function(){

    console.log('%s listening at %s', server.name, server.url);

});


You need to dissociate the creation of the server and the creation of the 
client json.

   1. create the server
   2. add some common handlers (if needed)
   3. create the needed routes
      1. associate this route to a function
      2. in this function create your client json
      3. use your client json to make the call
      4. when "ALL" data have been received then send the response
   4. launch the server

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to