forked from tekknoschtev/tcm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
31 lines (23 loc) · 901 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var express = require('express'),
mongoose = require('mongoose'),
fs = require('fs');
var db = mongoose.connect('mongodb://localhost/prsr');
//Bring in models. If adding more, need to write a method to do this.
require('./app/models/testplans');
var app = express();
var logFile = fs.createWriteStream('./logs/log_' + Date.now(), {flags: 'a'});
app.configure(function() {
app.set('port', process.env.PORT || 8080);
app.set('showStackError', true);
app.use(express.logger({stream: logFile}));
app.engine('.html', require('ejs').__express);
app.set('views', __dirname + '/app/views');
app.set('view engine', 'html');
app.use(express.static(__dirname + '/public'));
app.use(express.bodyParser());
app.use(app.router);
});
//bootstrap routes
require('./config/routes.js')(app);
app.listen(app.get('port'));
console.log('Express app started on port ' + app.get('port'));