Permalink
Browse files

updated to use browserify, staticProvider => static

  • Loading branch information...
1 parent ce12eb0 commit 57cc45d96d81c815f74f3eddf0e69911f09b48aa @substack committed Mar 27, 2011
Showing with 13 additions and 8 deletions.
  1. +1 −2 README.md
  2. +5 −2 steps/index.html
  3. +7 −4 steps/web.js
View
@@ -1,3 +1,2 @@
This repository is a dump of the steps from my article
-"Roll your own PubSub with DNode"
-at http://substack.net/posts/9bac3e
+["Roll your own PubSub with DNode"](http://substack.net/posts/9bac3e)
View
@@ -1,10 +1,13 @@
<html>
<head>
<title>Rolling your own PubSub with DNode!</title>
-<script src="/dnode.js" type="text/javascript"></script>
+<script src="/browserify.js" type="text/javascript"></script>
<script type="text/javascript">
+ var dnode = require('dnode');
+ var EventEmitter = require('events').EventEmitter;
+
window.onload = function () {
- DNode.connect(function (remote) {
+ dnode.connect(function (remote) {
var em = new EventEmitter;
em.on('data', function (n) {
View
@@ -1,10 +1,13 @@
var connect = require('connect');
-var webserver = connect.createServer(
- connect.staticProvider(__dirname)
-).listen(5051);
+var webserver = connect.createServer();
+
+webserver.use(connect.static(__dirname));
+webserver.use(require('browserify')({ require : 'dnode' }));
+
+webserver.listen(5051);
console.log('http://localhost:5051/');
-var Hash = require('traverse/hash'); // from my previous blog post!
+var Hash = require('hashish');
var subs = {};
function publish () {

0 comments on commit 57cc45d

Please sign in to comment.