From 3054ad19212c67128934d99fb5aae56760ecd77b Mon Sep 17 00:00:00 2001 From: Marian Oancea Date: Wed, 3 Dec 2014 05:47:43 +0200 Subject: [PATCH] changed to express.io --- app.js | 8 +++++--- package.json | 2 +- routes/index.js | 3 +-- routes/{users.js => stats.js} | 5 ++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename routes/{users.js => stats.js} (54%) diff --git a/app.js b/app.js index 4f6e0d8..3e4cebf 100644 --- a/app.js +++ b/app.js @@ -1,4 +1,4 @@ -var express = require('express'); +var express = require('express.io'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); @@ -6,7 +6,9 @@ var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var routes = require('./routes/index'); -var users = require('./routes/users'); +var stats = require('./routes/stats'); + +express().http().io(); var app = express(); @@ -24,7 +26,7 @@ app.use(require('stylus').middleware(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public'))); app.use('/', routes); -app.use('/users', users); +app.use('/stats', stats); // catch 404 and forward to error handler app.use(function(req, res, next) { diff --git a/package.json b/package.json index 99d532f..972afbd 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "start": "node ./bin/www" }, "dependencies": { - "express": "~4.9.0", + "express.io": "^1.1.13", "body-parser": "~1.8.1", "cookie-parser": "~1.3.3", "morgan": "~1.3.0", diff --git a/routes/index.js b/routes/index.js index 896c948..2b687d3 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,5 +1,4 @@ -var express = require('express'); -var router = express.Router(); +var router = require('express.io')(); /* GET home page. */ router.get('/', function(req, res) { diff --git a/routes/users.js b/routes/stats.js similarity index 54% rename from routes/users.js rename to routes/stats.js index c00d7de..18f0f41 100644 --- a/routes/users.js +++ b/routes/stats.js @@ -1,7 +1,6 @@ -var express = require('express'); -var router = express.Router(); +var router = require('express.io')(); -/* GET users listing. */ +/* GET stats listing. */ router.get('/', function(req, res) { res.send('respond with a resource'); });