UNPKG

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