From 631b4ea27ab6dd76030945906de44117c6a04801 Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 29 Sep 2010 14:02:26 -0700 Subject: [PATCH] Simplified the example as you do not need to specifiy the whole URL in an on/event --- samples/resource-routing.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/samples/resource-routing.js b/samples/resource-routing.js index d60ddd5..86e9a20 100644 --- a/samples/resource-routing.js +++ b/samples/resource-routing.js @@ -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 @@ -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); } @@ -73,4 +66,4 @@ var server = http.createServer(function (request, response) { }) } -}).listen(port, host); +}).listen(8000);