 app.use express.session()
 app.use app.router
 
-nconf.argv().env().file('config.json')
 
 # Create a configuration object
 config = {}


express = require 'express'
http = require 'http'
path = require 'path'
twilio = require 'twilio'
nconf = require 'nconf'
aws = require 'aws-sdk'


app = express()

    res.send(403)


server = http.createServer app

server.on 'error', (e) ->
  if e.code == 'EADDRINUSE'
    clientSocket = new net.Socket()
    clientSocket.on 'error', (e) ->
      if e.code == 'ECONNREFUSED'
        fs.unlink process.env.PORT
        server.listen process.env.PORT, ->
          console.log 'server recovered'

    clientSocket.connect (data =
      path: process.env.PORT
    ), ->
      console.log 'server running, giving up...'
      process.exit()

server.listen process.env.PORT, ->
  console.log 'Express server is running. Listening at: ' + process.env.PORT

