aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app.js
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-05-25 11:17:42 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-05-25 11:17:42 +0200
commite582c3b84c6090b08f33d599c354968fcd868d14 (patch)
treeb6de1b7b1f708bf9126ccb709d5129e91a67c7d5 /app.js
parentchanged what gets collected (diff)
downloadDivid-e582c3b84c6090b08f33d599c354968fcd868d14.tar.gz
moved and renamed files to match the filesetup we want.
havebeen using a dev-setup till now.
Diffstat (limited to 'app.js')
-rw-r--r--app.js66
1 files changed, 0 insertions, 66 deletions
diff --git a/app.js b/app.js
deleted file mode 100644
index d1911ee..0000000
--- a/app.js
+++ /dev/null
@@ -1,66 +0,0 @@
-
-/**
- * Module dependencies.
- */
-
-var express = require('express')
- , fs = require('fs')
- , passport = require('passport')
- , mongoose = require('mongoose');
-
-
-/**
- * App configuration
- */
-
-var port = process.env.PORT || 8000
- , env = process.env.NODE_ENV || 'development'
- , config = require('./config/config')[env]
- , auth = require('./config/middlewares/authorization');
-
-
-// Bootstrap db connection
-mongoose.connect(config.db);
-var db = mongoose.connection;
-db.on('error', console.error.bind(console, 'connection error:'));
-db.once('open', function callback(){
- console.log('Connected to ' + config.db);
-});
-
-
-// Bootstrap models
-// This gets all model files in ./models
-var models_path = __dirname + '/models';
-fs.readdirSync(models_path).forEach( function(file) {
- require(models_path + '/' + file);
-});
-
-
-// Bootstrap passport config
-require('./config/passport')(passport, config);
-
-
-/**
- * Express
- */
-
-var app = express();
-// express settings
-require('./config/express')(app, config, passport);
-
-
-/**
- * Routes
- */
-
-require('./routes')(app, passport, auth);
-
-
-/**
- * Server initiation
- */
-
-app.listen(port, function() {
- console.log("Express server listening on port " + port);
-});
-