Skip to content

Instantly share code, notes, and snippets.

@vgheri

vgheri/index.js

Created Apr 21, 2013
Embed
What would you like to do?
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
You can’t perform that action at this time.