1 |
|
2 | express = require 'express'
|
3 | coffee4clients = require 'coffee4clients'
|
4 | cwd = process.cwd()
|
5 | publicPath = process.argv[2]||cwd
|
6 | port = process.argv[3]||3000
|
7 |
|
8 |
|
9 | if publicPath.length is 0 or publicPath[0] is '.'
|
10 | publicPath = cwd + publicPath
|
11 |
|
12 |
|
13 | app = express.createServer()
|
14 |
|
15 |
|
16 | app.configure ->
|
17 | app.use express.static cwd
|
18 | app.use express.errorHandler {dumpExceptions: true, showStack: true }
|
19 | coffee4clients.setup app, publicPath
|
20 |
|
21 |
|
22 | app.listen port
|
23 | console.log 'Express server listening on port %d', app.address().port |
\ | No newline at end of file |