From d3ecf42d638e5207deb0f735ca21f0e2fe3be682 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 28 Jan 2011 14:55:00 +0100 Subject: remove trailing whitespaces --- src/nodejs/main.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/nodejs/main.js b/src/nodejs/main.js index f1197ea..e907f03 100644 --- a/src/nodejs/main.js +++ b/src/nodejs/main.js @@ -5,7 +5,7 @@ var pg = require('pg'); var xmlGenerator = require('./xmlGenerator.js'); var opts = require('opts'); var osmRes = require('./response'); -var log4js = require('log4js')(); +var log4js = require('log4js')(); var log = log4js.getLogger('global'); var config; @@ -51,8 +51,8 @@ function rowToNode(row){ 'key' : temp[x], 'value' : temp[x+1] }); - } - } + } + } return node; } @@ -73,8 +73,8 @@ function rowToWay(row){ 'k' : temp[x], 'v' : temp[x+1] }); - } - } + } + } return way; } @@ -98,7 +98,7 @@ function createWayBboxQuery(key, value, left, bottom, right, top) { ' st_setsrid(st_makepoint($3, $4), 4326), ' + ' st_setsrid(st_makepoint($5, $6), 4326) ' + ' ), 4326) ' + - ')', + ')', values: [key, value, left, bottom, right, top], name: 'way bbox query' }; @@ -152,7 +152,7 @@ function nodeWorldHandler(req, res, key, value) { function nodeBboxHandler(req, res, key, value, left, bottom, right, top) { res = osmRes.mkXmlRes(res); - + dbConnect(res, function(client) { var success = false; var query = client.query(createNodeBboxQuery(key, value, left, bottom, right, top)); @@ -166,7 +166,7 @@ function nodeBboxHandler(req, res, key, value, left, bottom, right, top) { }); query.on('row', function(row) { - var pojo = rowToNode(row); + var pojo = rowToNode(row); res.putNode(pojo); }); }); @@ -258,7 +258,7 @@ function init(newConfig) { log.info("server starting..."); log.info("loaded config from " + configPath); http.createServer(myRoutes).listen(config.port, config.host); - log.info("Started server at " + config.host + ":" + config.port ); + log.info("Started server at " + config.host + ":" + config.port ); } opts.parse(options, true); -- cgit v1.2.3 From e32ec046ef0588595cf0ada37ac0f9a6e994d534 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 28 Jan 2011 15:07:06 +0100 Subject: removed undefined variable --- src/nodejs/response.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nodejs/response.js b/src/nodejs/response.js index 45dcc89..9a92c66 100644 --- a/src/nodejs/response.js +++ b/src/nodejs/response.js @@ -41,7 +41,7 @@ exports.mkXmlRes = function (res){ } res.atEnd = function(){ if(!this.started){ - this.atStart(pojo); + this.atStart(); } this.write(''); this.end(); -- cgit v1.2.3 From 6a1fa18a04dfd3ef87a7386fe0f4a6a8f4d81149 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 28 Jan 2011 15:07:29 +0100 Subject: remove trailing whitespaces --- src/nodejs/response.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/nodejs/response.js b/src/nodejs/response.js index 9a92c66..b7fdd85 100644 --- a/src/nodejs/response.js +++ b/src/nodejs/response.js @@ -2,68 +2,68 @@ var xmlGen = require('./xmlGenerator'); // FIXME: this is a total mess exports.mkJsonRes = function mkJsonRes(res){ res.started = false; - res.atStart = function (){ + res.atStart = function (){ if(!this.started){ this.writeHead(200); this.write('json start start'); this.started = true; - } - } + } + } res.atEnd = function(){ if(!this.started){ this.atStart(pojo); - } + } this.write('json enden'); this.end(); - } + } res.putNode = function (pojo){ if(!this.started){ this.atStart(pojo); - } + } this.write(JSON.stringify(pojo)); - } + } res.endWith500 = function(){ this.writeHead(500); this.end(); - } + } return res; } exports.mkXmlRes = function (res){ res.started = false; - res.atStart = function (){ + res.atStart = function (){ if(!this.started){ this.writeHead(200); this.write(''); this.started = true; - } - } + } + } res.atEnd = function(){ if(!this.started){ this.atStart(); - } + } this.write(''); this.end(); - } + } res.putWay = function (pojo){ if(!this.started){ this.atStart(pojo); - } + } this.write(xmlGen.createWay(pojo)); - } + } res.putNode = function (pojo){ if(!this.started){ this.atStart(pojo); - } + } this.write(xmlGen.createNode(pojo)); - } + } res.endWith500 = function(){ this.writeHead(500); this.end(); - } + } return res; } -- cgit v1.2.3