+'use strict'
+###
+    Module dependencies.
+###
 express = require 'express'
+http = require('http')
 {join} = require 'path'
 {config} = require './config'
+
+app = express()
+server = http.createServer(app)
+app.set('port', process.env.PORT || 4000)
+###
+    Require routes.
+###
 routes = require './routes'
 backbone = require './routes/index'
 collector = require './routes/collector'

    # TODO Non automatic content type
    next()

loginMiddleware = (req, res, next) ->
    # Login middleware
    # add loginMiddleware as second argument for

room = require './routes/room'
login = require './routes/login'


# Allow Cross Origin middleware
app.use '/', (req, res, next) ->
    res.header("Access-Control-Allow-Origin", "*")
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS')
