Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
32 lines (26 sloc) 1.07 KB
express = require 'express'
routes = require './routes'
db = require './db'
RedisStore = (require 'connect-redis')(express)
_ = require 'underscore'
app = module.exports = express.createServer()
app.configure ->
app.set 'views', "#{__dirname}/views"
app.set 'view engine', 'ejs'
app.set 'view options', layout: off
app.use express.bodyParser()
app.use express.compiler src: "#{__dirname}/public", enable: ['coffeescript']
app.use express.methodOverride()
app.use express.cookieParser()
app.use express.session secret: 'pinkie is best pony', store: new RedisStore(host: 'ponyfolderdb-lambda.dotcloud.com', port: 17241, user: 'root', pass: 's7BrxSKi00n4I4Ksb7xj'), key: 'express.sid', cookie: maxAge: 120*60, httpOnly: yes, path: '/'
app.use require('stylus').middleware src: "#{__dirname}/public"
app.use app.router
app.use express.static(__dirname + "/public")
app.use express.errorHandler
dumpExceptions: true
showStack: true
app.get '/', routes.index
app.post '/', routes.indexPost
app.post '/save', routes.save
app.get '/win', routes.win
app.get '/ipad', routes.ipad