aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/www.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/www.js b/bin/www.js
index 9cc2f2d..e7c80f3 100644
--- a/bin/www.js
+++ b/bin/www.js
@@ -1,4 +1,4 @@
-
+var dbFile = require('../node_simple');
var app = require('../app');
var http = require('http');
@@ -7,7 +7,15 @@ var server = http.createServer(app);
var port = '3000';
app.set('port', port);
-server.listen(port, function(){
- console.log('listening on port 3000');
+dbFile.setupDB(function (success, mssg) {
+ if (success) { // db establiseh
+ server.listen(port, function(){ // now accept connections
+ console.log('listening on port 3000');
+ });
+ }
+ else {
+ console.log(mssg);
+ }
});
+