       else
         @res.render("slidecast",slidecast: content)
 
+http = require("http")
+express = require('express')
+ehbs = require("express3-handlebars")
+
 class App
-  setup: (@express) ->
+  constructor: () ->
+    @setupExpress()
+
+  setupExpress: ->
+    @express = express()
+
+    @express.engine('.hbs.html', ehbs({defaultLayout: 'main',extname: '.hbs.html'}))
+    @express.set('view engine', '.hbs.html')
+    @express.use(express.static(__dirname))
+
     @handle "get", "/", Home
     @handle "get", '/ide/:name', ShowIDE
     @handle "get", '/bootstrap', ShowBootstrapDemo
     @handle "get", '/:name', ShowSlideCast
+
+  start: (port) ->
+    @server = http.createServer(@express)
+    @server.listen(port || 3000)
+    @socket = require("socket.io").listen(@server)
+    console.log "Listening to port #{port}"
 
   handle: (verb,path,action) ->
     handler = (req,res) -> 

express = require('express')
ehbs = require("express3-handlebars")

app = express()

app.engine('.hbs.html', ehbs({defaultLayout: 'main',extname: '.hbs.html'}))
app.set('view engine', '.hbs.html')

class ControllerAction
  constructor: (@req,@res) ->
    @params = @req.params


    @express[verb](path, handler)

app = new App()
app.start(3000)



