keeper/keeper-server.js

42 lines
1.0 KiB
JavaScript
Raw Normal View History

2016-03-02 13:53:28 +00:00
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);
2017-05-30 08:24:53 +00:00
app.engine('html', require('ejs').renderFile);
//app.set('views', path.join(__dirname, 'views'));
//app.set('view engine', 'ejs');
app.set('view engine', 'html');
2016-03-02 13:53:28 +00:00
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cookieParser());
2017-05-30 08:24:53 +00:00
//app.use(express.static(path.join(__dirname, 'dist')));
app.use(express.static(path.join(__dirname, 'app')));
2016-03-02 13:53:28 +00:00
app.use('/', keeper);
2017-05-30 08:24:53 +00:00
app.get('/v2', function(req, res) {
res.render('../app/indexV2.html');
});
2016-03-02 13:53:28 +00:00
/**
* 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.
*/