aboutsummaryrefslogtreecommitdiffstats
path: root/src/nodejs
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-01-21 16:01:22 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2011-01-21 16:01:22 +0100
commit133808adffc94377568b00c0ef2cab98fc5e6e4f (patch)
tree9584340c5ee2ef969130f7536b8a77450539a7f8 /src/nodejs
parentf7857666f01591e50c9ef377651710da3455eef4 (diff)
parent3cdab5dcde696223cf240aedbe774951da1ad7bb (diff)
downloadosm-xapi-133808adffc94377568b00c0ef2cab98fc5e6e4f.tar.gz
osm-xapi-133808adffc94377568b00c0ef2cab98fc5e6e4f.tar.xz
osm-xapi-133808adffc94377568b00c0ef2cab98fc5e6e4f.zip
Merge branch 'master', remote branch 'upstream/master'
Diffstat (limited to 'src/nodejs')
-rw-r--r--src/nodejs/no1.js20
-rw-r--r--src/nodejs/package.json19
2 files changed, 24 insertions, 15 deletions
diff --git a/src/nodejs/no1.js b/src/nodejs/no1.js
index b66940b..edb7110 100644
--- a/src/nodejs/no1.js
+++ b/src/nodejs/no1.js
@@ -2,26 +2,34 @@
var clutch = require('clutch');
var pg = require('pg');
var builder = require('xmlbuilder');
-var config = require('./config.json');
+
+
// load config
+var config = require('./config.json');
process.argv.forEach(
function (val,index, array){
if(val=="-c"){
path = array[index+1];
- console.log(path[0]);
if( path[0] != '/'){
path = __dirname + '/' + path;
}
config = require(path);
}
});
-
var connectionString = config['connectionString'];
-console.log("server starting...");
-console.log("Connection String: " + connectionString);
+
+
+//set up logger
+var log4js = require('log4js')(); //note the need to call the function
+//log4js.addAppender(log4js.fileAppender('osm-xapi.log'), 'cheese');
+
+var logger = log4js.getLogger('global');
+logger.setLevel('ALL');
+
+logger.info("server starting...");
function toISO8601(date) {
//2007-03-31T00:09:22+01:00
@@ -259,4 +267,4 @@ myRoutes = clutch.route404([
var http = require('http');
http.createServer(myRoutes).listen(config.port, config.host);
-console.log("Started server at " + config.host + ":" + config.port );
+logger.info("Started server at " + config.host + ":" + config.port );
diff --git a/src/nodejs/package.json b/src/nodejs/package.json
index cbe341f..3ff8b8b 100644
--- a/src/nodejs/package.json
+++ b/src/nodejs/package.json
@@ -1,11 +1,12 @@
-{ "name" : "xapi-osm-spline"
-, "version" : "0.0.1"
-, "description" : "An osm xapi implementation"
-, "autor" : "osm@spline <osm@lists.spline.de> (http://osm.spline.de)"
-, "files" : ["."]
-, "dependencies" :
- { "pg" : "*"
- , "clutch" : "*"
- , "xmlbuilder" : "*"
+{ 'name' : 'xapi-osm-spline'
+, 'version' : '0.0.1'
+, 'description' : 'An osm xapi implementation'
+, 'autor' : 'osm@spline <osm@lists.spline.de> (http://osm.spline.de)'
+, 'files' : ['.']
+, 'dependencies' :
+ { 'pg' : '*'
+ , 'clutch' : '*'
+ , 'xmlbuilder' : '*'
+ , 'log4js' : '*'
}
}