recipes/recipe-server.js

31 lines
827 B
JavaScript
Raw Permalink Normal View History

2016-06-30 13:44:49 +00:00
var express = require('express');
var path = require('path');
var http = require('http');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var keeper = require('./server/keeper');
2016-02-22 17:05:13 +00:00
var app = express();
app.set('port', process.env.PORT || 8025);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cookieParser());
2016-06-30 13:44:49 +00:00
app.use(express.static(path.join(__dirname, 'dist')));
2016-02-22 17:05:13 +00:00
2016-06-30 13:44:49 +00:00
app.use('/', keeper);
2016-02-22 17:05:13 +00:00
/**
* create the server
*/
app.listen(app.get('port'), function () {
2016-06-30 13:44:49 +00:00
console.log('Keeper Server listening on ' + app.get('port'));
2016-02-22 17:05:13 +00:00
});/**
* Created by Martin on 22/02/2016.
*/