Permalink
Browse files

fix upload demo to run with express 3

  • Loading branch information...
1 parent 1b98b34 commit fd03590e2b4aaa905b6cc1b88e35a72198e7583b @orefalo orefalo committed Sep 5, 2012
Showing with 10 additions and 9 deletions.
  1. +10 −9 examples/fileupload/server.js
@@ -1,19 +1,19 @@
var fs = require('fs');
+var http = require('http');
+
// Serve client side statically
var express = require('express');
-var app = express.createServer();
+var app = express();
app.use(express.static(__dirname + '/public'));
-// Start Binary.js server
-var BinaryServer = require('binaryjs').BinaryServer;
-var server = BinaryServer({server: app});
+var server = http.createServer(app);
-app.listen(9000);
+// Start Binary.js server
+var BinaryServer = require('../../').BinaryServer;
+var bs = BinaryServer({server: server});
-//
-//
// Wait for new user connections
-server.on('connection', function(client){
+bs.on('connection', function(client){
// Incoming stream from browsers
client.on('stream', function(stream, meta){
//
@@ -30,4 +30,5 @@ server.on('connection', function(client){
//
//
-console.log('HTTP and BinaryJS server started on port 9000');
+server.listen(9000);
+console.log('HTTP and BinaryJS server started on port 9000');

0 comments on commit fd03590

Please sign in to comment.