-
Notifications
You must be signed in to change notification settings - Fork 32
/
app.coffee
executable file
·40 lines (32 loc) · 902 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
40
express = require 'express'
require 'express-resource'
require 'express-namespace'
config = require './config/config'
cors = require './middlewares/cors'
stylus = require './middlewares/stylus'
session_expires = 72000000
module.exports = app = express()
#
# App Setting
#
app.configure ->
app.set 'view engine', 'jade'
app.set 'views', __dirname + '/views'
app.use express.bodyParser()
app.use express.methodOverride()
app.use express.cookieParser()
app.use express.cookieSession
secret: 'this is a screen'
cookie:
expires : new Date(Date.now() + session_expires)
maxAge : session_expires
app.use cors
app.use app.router
app.use stylus
app.use express.static __dirname + '/public'
app.configure 'development', ->
app.use express.errorHandler
dumpExceptions: true
showStack: true
app.configure 'production', ->
app.use express.errorHandler()