 express = require 'express'
 RedisStore = require('connect-redis')(express)
+
+try
+    require "../../cozy-home/settings"
+catch error
+    global.secret_cookie_key = "secret"
+    global.secret_session_key = "secret"
+
+
 
 passport = require 'passport'
 

        else
            done err, null

# TODO make secret unique
app.configure ->
    cwd = process.cwd()
    


    app.use express.static(cwd + '/client/public', maxAge: 86400000)
    app.use express.bodyParser()
    app.use express.cookieParser global.secret_cookie_key
    app.use express.session secret: global.secret_session_key, store: new RedisStore(db:'cozy')
    app.use express.methodOverride()
    app.use passport.initialize()
    app.use passport.session()
