recipes/recipe-server.js
Martin Donnelly 18a0e18bf0 initial
2016-02-22 17:05:13 +00:00

47 lines
1.1 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'),
routes = require('./routes/index'),
users = require('./routes/users')
//train = require('lib/train')
/* ,submit = require('./routes/mongo/submit') */
;
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());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', routes);
//app.use('/users', users);
/*
app.use('/time', timeroute);
app.use('/btc', btcroute);
app.use('/temp',temproute);
app.use('/weight',weightroute);
*/
/**
* create the server
*/
app.listen(app.get('port'), function () {
console.log('Recipe Server listening on ' + app.get('port'));
});/**
* Created by Martin on 22/02/2016.
*/