42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
var express = require('express'), path = require('path'), http = require('http'),
|
|
|
|
|
|
favicon = require('serve-favicon'),
|
|
logger = require('morgan'),
|
|
cookieParser = require('cookie-parser'),
|
|
bodyParser = require('body-parser'),
|
|
keeper = require('./server/keeper')
|
|
|
|
;
|
|
var app = express();
|
|
|
|
app.set('port', process.env.PORT || 8026);
|
|
app.engine('html', require('ejs').renderFile);
|
|
//app.set('views', path.join(__dirname, 'views'));
|
|
//app.set('view engine', 'ejs');
|
|
app.set('view engine', 'html');
|
|
|
|
app.use(logger('dev'));
|
|
app.use(bodyParser.json());
|
|
app.use(bodyParser.urlencoded({ extended: true }));
|
|
app.use(cookieParser());
|
|
|
|
//app.use(express.static(path.join(__dirname, 'dist')));
|
|
app.use(express.static(path.join(__dirname, 'app')));
|
|
|
|
app.use('/', keeper);
|
|
|
|
app.get('/v2', function(req, res) {
|
|
res.render('../app/indexV2.html');
|
|
});
|
|
|
|
/**
|
|
* create the server
|
|
*/
|
|
|
|
app.listen(app.get('port'), function () {
|
|
console.log('Keeper Server listening on ' + app.get('port'));
|
|
});/**
|
|
* Created by Martin on 22/02/2016.
|
|
*/
|