Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix upload demo to run with express 3

  • Loading branch information...
commit fd03590e2b4aaa905b6cc1b88e35a72198e7583b 1 parent 1b98b34
@orefalo orefalo authored
Showing with 10 additions and 9 deletions.
  1. +10 −9 examples/fileupload/server.js
View
19 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');
Please sign in to comment.
Something went wrong with that request. Please try again.