mirror of
https://gitlab.silvrtree.co.uk/martind2000/recipes.git
synced 2025-01-26 20:46:17 +00:00
47 lines
1.1 KiB
JavaScript
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.
|
|
*/
|