Skip to content

Commit

Permalink
Simplified the example as you do not need to specifiy the whole URL i…
Browse files Browse the repository at this point in the history
…n an on/event
  • Loading branch information
jsgoecke committed Sep 29, 2010
1 parent c2a0a0a commit 631b4ea
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions samples/resource-routing.js
Expand Up @@ -8,13 +8,6 @@
var http = require('http');
var tropo = require('../lib/tropo-webapi');

var host = "somefakehost.com";
var port = 8000;

function buildUrl(path) {
return 'http://' + host + ':' + port + '/' + path;
}

var server = http.createServer(function (request, response) {

// Reject the request if not POST
Expand Down Expand Up @@ -52,7 +45,7 @@ var server = http.createServer(function (request, response) {

// Action classes can be passes as parameters to TropoWebAPI class methods.
tropo.ask(choices, 3, false, null, "foo", null, true, say, 5, null);
tropo.on("continue", null, buildUrl('answer'), true);
tropo.on("continue", null, '/answer', true);

}

Expand All @@ -73,4 +66,4 @@ var server = http.createServer(function (request, response) {
})
}

}).listen(port, host);
}).listen(8000);

0 comments on commit 631b4ea

Please sign in to comment.