Skip to content

Instantly share code, notes, and snippets.

@vgheri
Created April 21, 2013 12:57
Show Gist options
  • Save vgheri/5429499 to your computer and use it in GitHub Desktop.
Save vgheri/5429499 to your computer and use it in GitHub Desktop.
var config = require('./Config-debug');
var winston = require('winston');
var mongoose = require('mongoose');
var server = require('./Server');
// We will log normal api operations into api.log
console.log("starting logger...");
winston.add(winston.transports.File, {
filename: config.logger.api
});
// We will log all uncaught exceptions into exceptions.log
winston.handleExceptions(new winston.transports.File({
filename: config.logger.exception
}));
console.log("logger started. Connecting to MongoDB...");
mongoose.connect(config.db.mongodb);
console.log("Successfully connected to MongoDB. Starting web server...");
server.start();
console.log("Successfully started web server. Waiting for incoming connections...");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment