     stream.push null
     stream.emit 'close'
 
-    numClients--
-    console.log 'client went away', numClients
+    console.log 'client went away'
     client.close reason
 
   stream.on 'end', ->

livedb = require 'livedb'
livedbMongo = require 'livedb-mongo'
http = require 'http'

try
  require 'heapdump'

sharejs = require '../lib'



# app.use '/doc', share.rest()

backend = livedb.client livedb.memory()
#backend = livedb.client livedbMongo('localhost:27017/test?auto_reconnect', safe:false)

share = sharejs.server.createClient {backend}


server = http.createServer app
