Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (20 sloc) 870 Bytes
express = require 'express'
pipeline = require 'connect-assets'
mongoose = require 'mongoose'
mongoose.connect "mongodb://#{process.env.MONGO_USER}:#{process.env.MONGO_PASSWORD}@flame.mongohq.com:27036/metrics"
# mongoose.connectSet('mongodb://localhost:9991/words,mongodb://localhost:9992/words,mongodb://localhost:9993/words')
app = express express.logger()
app.use express.bodyParser()
app.use pipeline()
models = require './app/models/Models'
routes = require './app/routes/Index'
app.set 'view engine', 'jade'
app.use '/img', express.static(__dirname + '/public/img')
app.use '/js', express.static(__dirname + '/public/js')
app.use '/css', express.static(__dirname + '/public/css')
app.post '/', routes.post
app.get '/', routes.get
app.post '/new_word', routes.new_word
port = process.env.PORT or 3000
app.listen port, ->
console.log "listening on #{port}"