Permalink
Browse files

Wrapper de socket.io

  • Loading branch information...
1 parent d04c980 commit 0b7491da7c31fc4d7e7fd3d5f7ebb4313852396e Ricardo Lanziano committed Jan 24, 2012
Showing with 10 additions and 3 deletions.
  1. +8 −2 app.js
  2. +2 −1 views/layout.jade
View
10 app.js
@@ -3,8 +3,10 @@
* Module dependencies.
*/
-var express = require('express')
- , routes = require('./routes')
+var express = require('express'),
+ mongoose = require('mongoose'),
+ io = require('socket.io'),
+ routes = require('./routes')
var app = module.exports = express.createServer();
@@ -32,5 +34,9 @@ app.configure('production', function(){
app.get('/', routes.index);
+// Wrap socket.io in app
+
+io.listen(app);
+
app.listen(3000);
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
View
@@ -3,4 +3,5 @@ html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
- body!= body
+ body!= body
+ script(src='/socket.io/socket.io.js')

0 comments on commit 0b7491d

Please sign in to comment.