Commit 0853cfad authored by Leo Iannacone's avatar Leo Iannacone

update to express 3.x

parent 8fe66560
...@@ -7,23 +7,25 @@ var express = require('express') ...@@ -7,23 +7,25 @@ var express = require('express')
, routes = require('./routes') , routes = require('./routes')
, config = require('./lib/config.js') , config = require('./lib/config.js')
, utils = require('./lib/utils.js') , utils = require('./lib/utils.js')
, http = require('http')
, partials = require('express-partials')
, app = module.exports = express()
, Client = require('./lib/client.js') , Client = require('./lib/client.js')
, Broadcaster = require('./lib/broadcaster.js') , Broadcaster = require('./lib/broadcaster.js')
var app = module.exports = express.createServer();
var io = require('socket.io').listen(app, config.socket);
// Configuration // Configuration
app.configure(function(){ app.configure(function(){
app.set('views', __dirname + '/views'); app.set('views', __dirname + '/views');
app.set('view engine', 'ejs'); app.set('view engine', 'ejs');
app.use(partials());
app.use(express.bodyParser()); app.use(express.bodyParser());
app.use(express.methodOverride()); app.use(express.methodOverride());
app.use(app.router); app.use(app.router);
app.use(express.static(__dirname + '/public')); app.use(express.static(__dirname + '/public'));
app.use(config.routes.debomatic, express.directory(config.debomatic.path)); app.use(config.routes.debomatic, express.directory(config.debomatic.path));
app.use(config.routes.debomatic, express.static(config.debomatic.path)); app.use(config.routes.debomatic, express.static(config.debomatic.path));
//app.enable('trust proxy');
}); });
app.configure('development', function(){ app.configure('development', function(){
...@@ -40,8 +42,11 @@ app.get(config.routes.distribution, routes.distribution) ...@@ -40,8 +42,11 @@ app.get(config.routes.distribution, routes.distribution)
if (config.routes.preferences) if (config.routes.preferences)
app.get(config.routes.preferences, routes.preferences) app.get(config.routes.preferences, routes.preferences)
var server = http.createServer(app)
, io = require('socket.io').listen(server, config.socket)
// Listening // Listening
var server = app.listen(config.port, config.host, null, function(err){ server.listen(config.port, config.host, null, function(err){
// Checking nodejs with sudo: // Checking nodejs with sudo:
// Find out which user used sudo through the environment variable // Find out which user used sudo through the environment variable
...@@ -66,7 +71,7 @@ var server = app.listen(config.port, config.host, null, function(err){ ...@@ -66,7 +71,7 @@ var server = app.listen(config.port, config.host, null, function(err){
client.send_status(status) client.send_status(status)
}); });
console.log("Debomatic-webui listening on %s:%d in %s mode", app.address().address, app.address().port, app.settings.env); console.log("Debomatic-webui listening on %s:%d in %s mode", server.address().address, server.address().port, app.settings.env);
}); });
server.on('error', function (e) { server.on('error', function (e) {
......
...@@ -3,8 +3,9 @@ ...@@ -3,8 +3,9 @@
, "version": "0.0.1" , "version": "0.0.1"
, "private": true , "private": true
, "dependencies": { , "dependencies": {
"express": "2.5.8" "express": "3.4.8"
, "ejs": ">= 0.0.1" , "ejs": ">= 0.0.1"
, "express-partials": "*"
, "socket.io": "*" , "socket.io": "*"
, "node-fs": "*" , "node-fs": "*"
, "tailfd": "*" , "tailfd": "*"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment