-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.coffee
39 lines (27 loc) · 909 Bytes
/
app.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
express = require 'express'
app = require('express')()
server = require('http').createServer app
io = require('socket.io').listen server
routes = require './routes'
models = require './models'
colors = require 'colors'
cron = require './lib/cron'
dust = require 'dustjs-linkedin'
cons = require 'consolidate'
app.set 'view engine', 'dust'
app.set 'template engine', 'dust'
app.engine 'dust', cons.dust
app.set 'port', process.env.PORT || 3000
app.set 'views', __dirname + '/views'
app.use express.bodyParser()
app.use express.static(__dirname + '/public')
app.use app.router
if 'development' == app.get 'env'
app.use express.errorHandler()
app.get '/twil', routes.twil
app.get '/*', routes.export
app.get '/', routes.index
server.listen 3000
console.log ('SUCCESS: Express listening on ' + app.get('port')).green
console.log 'INFO: You got this!'.cyan
cron.checkUp()