aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Engel <mark.c.engel@gmail.com>2011-01-21 14:22:19 +0100
committerMark Engel <mark.c.engel@gmail.com>2011-01-21 14:22:19 +0100
commit688fc4727124a3f4e8ac33ed73a8df05f681283c (patch)
treeb24013372b31152ed6d402b71a086810363cc572
parent5d7f1d4e1feda2fa4e3f7655404737d85276e8a9 (diff)
downloadosm-xapi-688fc4727124a3f4e8ac33ed73a8df05f681283c.tar.gz
osm-xapi-688fc4727124a3f4e8ac33ed73a8df05f681283c.tar.xz
osm-xapi-688fc4727124a3f4e8ac33ed73a8df05f681283c.zip
externalized config (connectionString)
-rw-r--r--src/nodejs/config.json1
-rw-r--r--src/nodejs/no1.js10
2 files changed, 8 insertions, 3 deletions
diff --git a/src/nodejs/config.json b/src/nodejs/config.json
new file mode 100644
index 0000000..1025c5b
--- /dev/null
+++ b/src/nodejs/config.json
@@ -0,0 +1 @@
+exports.connectionString = "pg://user:password@host/database";
diff --git a/src/nodejs/no1.js b/src/nodejs/no1.js
index 6c6809e..1132a11 100644
--- a/src/nodejs/no1.js
+++ b/src/nodejs/no1.js
@@ -1,9 +1,13 @@
var clutch = require('clutch');
-var pg = require('pg')
-var builder = require('xmlbuilder')
+var pg = require('pg');
+var builder = require('xmlbuilder');
+var config = require('./config.json');
-var connectionString = "pg://user:password@host/database";
+
+var connectionString = config['connectionString'];
+console.log("server starting...");
+console.log("Connection String: " + connectionString);
function toISO8601(date) {
//2007-03-31T00:09:22+01:00