Permalink
Browse files

Merge pull request #17 from orefalo/fix-upload-sample

fix upload demo to run with express 3
  • Loading branch information...
2 parents 1b98b34 + fd03590 commit bf1ea47735925463990b19a1715a197a031c414b @ericz ericz committed Sep 17, 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 bf1ea47

Please sign in to comment.