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 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) {

View File

@ -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",

View File

@ -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) {

View File

@ -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');
});