-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.coffee
More file actions
executable file
·27 lines (20 loc) · 860 Bytes
/
app.coffee
File metadata and controls
executable file
·27 lines (20 loc) · 860 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
express = require 'express'
app = express.createServer()
port = process.env.PORT || 3000
path = require 'path'
stylus = require 'stylus'
data = require './data'
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.set 'views', path.join(__dirname, 'views')
app.set 'view engine', 'jade'
app.get '/', data.load('tweets', 'messages', 'events', 'gitEvents'), (req, res) ->
res.render 'layout', res.data
app.listen port
console.log 'server listening on port ' + port