     # TODO Non automatic content type
     next()
 
+###
+    Define all the middleware use by the application.
+    The order in which they are defined is important.
+###
 loginMiddleware = (req, res, next) ->
     # Login middleware
     # add loginMiddleware as second argument for

express = require 'express'
{join} = require 'path'
{config} = require './config'
routes = require './routes'
backbone = require './routes/index'
collector = require './routes/collector'

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')
