2017-06-27 16:11:07 +00:00
|
|
|
const express = require('express'), path = require('path'), http = require('http'),
|
2017-05-30 08:24:53 +00:00
|
|
|
|
|
|
|
|
2017-06-27 16:11:07 +00:00
|
|
|
favicon = require('serve-favicon'),
|
|
|
|
logger = require('morgan'),
|
|
|
|
cookieParser = require('cookie-parser'),
|
|
|
|
bodyParser = require('body-parser'),
|
|
|
|
keeper = require('./server/keeperV2')
|
2017-05-30 08:24:53 +00:00
|
|
|
|
2017-06-27 16:11:07 +00:00
|
|
|
;
|
|
|
|
const app = express();
|
2017-05-30 08:24:53 +00:00
|
|
|
|
|
|
|
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());
|
2017-06-27 16:11:07 +00:00
|
|
|
app.use(bodyParser.urlencoded({extended: true}));
|
2017-05-30 08:24:53 +00:00
|
|
|
app.use(cookieParser());
|
|
|
|
|
|
|
|
//app.use(express.static(path.join(__dirname, 'dist')));
|
|
|
|
app.use(express.static(path.join(__dirname, 'app')));
|
|
|
|
|
|
|
|
app.use('/', keeper);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* create the server
|
|
|
|
*/
|
|
|
|
|
2017-06-27 16:11:07 +00:00
|
|
|
app.listen(app.get('port'), function() {
|
|
|
|
console.log('Keeper Server listening on ' + app.get('port'));
|
|
|
|
});
|
|
|
|
/**
|
2017-05-30 08:24:53 +00:00
|
|
|
* Created by Martin on 22/02/2016.
|
|
|
|
*/
|