From fd9de92bc5b3f231737e4fdd30aabb5e833b76ac Mon Sep 17 00:00:00 2001 From: Amos Haviv Date: Sun, 23 Jun 2013 20:46:08 +0300 Subject: [PATCH] Adding the logger module --- app/controllers/index.js | 3 +++ config/config.js | 3 ++- server.js | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/index.js b/app/controllers/index.js index b350ac37e6..4f4dfe625c 100644 --- a/app/controllers/index.js +++ b/app/controllers/index.js @@ -5,9 +5,12 @@ var mongoose = require('mongoose') , async = require('async') , _ = require('underscore') + , logger = require('mean-logger') exports.render = function(req, res){ + logger.log("test"); + res.render('index', { user: req.user ? JSON.stringify(req.user) : "null" }) diff --git a/config/config.js b/config/config.js index ae69b89d89..f151943f92 100755 --- a/config/config.js +++ b/config/config.js @@ -14,7 +14,8 @@ var path = require('path') module.exports = { development: { - db: 'mongodb://localhost/mean-dev', + // db: 'mongodb://localhost/mean-dev', + db: 'mongodb://admin:password@ds027308.mongolab.com:27308/meanstack', root: rootPath, notifier: notifier, app: { diff --git a/server.js b/server.js index 093f463e15..8ea85f78fb 100755 --- a/server.js +++ b/server.js @@ -11,6 +11,7 @@ var express = require('express') , fs = require('fs') , passport = require('passport') + , logger = require('mean-logger') /** * Main application entry file. @@ -49,5 +50,8 @@ var port = process.env.PORT || 3000 app.listen(port) console.log('Express app started on port '+port) +//Initializing logger +logger.init(app, passport, mongoose) + // expose app exports = module.exports = app