2016-02-22 17:05:13 +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'),
|
2016-02-24 11:48:09 +00:00
|
|
|
recipes = require('./server/recipes')
|
2016-02-22 17:05:13 +00:00
|
|
|
|
2016-02-24 11:48:09 +00:00
|
|
|
/*
|
2016-02-22 17:05:13 +00:00
|
|
|
routes = require('./routes/index'),
|
|
|
|
users = require('./routes/users')
|
2016-02-24 11:48:09 +00:00
|
|
|
*/
|
2016-02-22 17:05:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
//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());
|
2016-02-24 15:07:47 +00:00
|
|
|
app.use(express.static(path.join(__dirname, 'app')));
|
2016-02-22 17:05:13 +00:00
|
|
|
|
2016-02-24 11:48:09 +00:00
|
|
|
app.use('/recipes', recipes);
|
2016-02-22 17:05:13 +00:00
|
|
|
//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.
|
|
|
|
*/
|