-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.coffee
48 lines (32 loc) · 993 Bytes
/
server.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
41
42
43
44
45
46
47
48
# Requires
#docpad = require 'docpad' #it dosen't work why?
docpad = require "#{__dirname}/node_modules/docpad/out/lib/docpad"
express = require 'express'
# =====================================
# Configuration
# Variables
oneDay = 86400000
expiresOffset = oneDay
# Configuration
docpadPort = process.env.VCAP_APP_PORT || process.env.PORT || 3000
# Create Servers
docpadServer = express()
# Configure DocPad
docpadConfig =
port: docpadPort
maxAge: expiresOffset
server: docpadServer
checkVersion: false
# =====================================
# Start & Extend DocPad
# Create DocPad, and wait for it to load
docpad.createInstance docpadConfig, (err,docpadInstance) ->
# Prepare
console.log err.stack if err
docpadInstance.action "server generate watch", (error) ->
console.log error.stack if error
console.log 'OK,Docpad was Initialized'
# =====================================
# Exports
# Export the DocPad Server we created
module.exports = docpadServer