 express = require 'express'
 io = require 'socket.io'
-Backbone = require 'backbone'
 VIE = require '../js/vie.js'
 require './vie-redis.coffee'
 fs = require 'fs'
 jQuery = require 'jquery'
+jsdom = require 'jsdom'
 
 server = express.createServer()
 server.configure -> 

# Serve the index file for /
server.get '/meetings', (request, response) ->
    return fs.readFile "#{process.cwd()}/meetings.html", "utf-8", (err, data) ->
        html = jQuery data
        # Find RDFa entities and load them
        VIE.RDFaEntities.getInstances html
        # Get the Calendar object
        calendar = VIE.EntityManager.getBySubject '/meetings'
        

        return events.fetch
            success: (eventCollection) ->
                VIE.cleanup()
                return response.send window.document.innerHTML

server.get '/foo', (req, resp) ->
    html = jQuery('html')
