changed to express.io

This commit is contained in:
Marian Oancea 2014-12-03 05:47:43 +02:00
parent 70d0ea6839
commit 3054ad1921
4 changed files with 9 additions and 9 deletions

8
app.js
View File

@ -1,4 +1,4 @@
var express = require('express'); var express = require('express.io');
var path = require('path'); var path = require('path');
var favicon = require('serve-favicon'); var favicon = require('serve-favicon');
var logger = require('morgan'); var logger = require('morgan');
@ -6,7 +6,9 @@ var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser'); var bodyParser = require('body-parser');
var routes = require('./routes/index'); var routes = require('./routes/index');
var users = require('./routes/users'); var stats = require('./routes/stats');
express().http().io();
var app = express(); 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(express.static(path.join(__dirname, 'public')));
app.use('/', routes); app.use('/', routes);
app.use('/users', users); app.use('/stats', stats);
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function(req, res, next) {

View File

@ -6,7 +6,7 @@
"start": "node ./bin/www" "start": "node ./bin/www"
}, },
"dependencies": { "dependencies": {
"express": "~4.9.0", "express.io": "^1.1.13",
"body-parser": "~1.8.1", "body-parser": "~1.8.1",
"cookie-parser": "~1.3.3", "cookie-parser": "~1.3.3",
"morgan": "~1.3.0", "morgan": "~1.3.0",

View File

@ -1,5 +1,4 @@
var express = require('express'); var router = require('express.io')();
var router = express.Router();
/* GET home page. */ /* GET home page. */
router.get('/', function(req, res) { router.get('/', function(req, res) {

View File

@ -1,7 +1,6 @@
var express = require('express'); var router = require('express.io')();
var router = express.Router();
/* GET users listing. */ /* GET stats listing. */
router.get('/', function(req, res) { router.get('/', function(req, res) {
res.send('respond with a resource'); res.send('respond with a resource');
}); });