-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.coffee
More file actions
executable file
·28 lines (22 loc) · 896 Bytes
/
app.coffee
File metadata and controls
executable file
·28 lines (22 loc) · 896 Bytes
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
express = require 'express'
app = express.createServer()
port = process.env.PORT || 3000
path = require 'path'
stylus = require 'stylus'
site = require './controllers/site'
hooks = require './controllers/hooks'
app.use express.bodyParser()
app.set 'views', path.join(__dirname, 'views')
app.set 'view engine', 'jade'
app.configure 'development', () ->
app.use stylus.middleware { src: path.join(__dirname, 'public') }
app.use express.logger { format: ':method :url' }
app.use express.static path.join(__dirname, 'public')
app.configure 'production', () ->
app.use stylus.middleware { src: path.join(__dirname, 'public'), compress: true }
app.use express.logger { format: ':method :url' }
app.use express.static path.join(__dirname, 'public')
app.get '/', site.index
app.post '/hook/pull-request', hooks.pullRequest
app.listen port
console.log 'server listening on port ' + port