Skip to content

Commit

Permalink
updated arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
julien committed Jul 12, 2012
1 parent 2f1e8af commit e5974bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app.coffee
Expand Up @@ -18,14 +18,14 @@ app = express.createServer()

### parse args (- coffee and the filename) ###
ARGV = process.argv[2..]
rargs = /--\w+/
rprod = /^--production/
rargs = /-{1,2}\w+/
rprod = /-{1,2}(p|production)/

for s in ARGV
m = rargs.exec s
app.env = 'production' if m and m[0] and m[0].match rprod


console.log app.env
### express configuration ###
app.configure ->
app.set 'views', __dirname + '/views'
Expand Down Expand Up @@ -77,4 +77,4 @@ app.listen 3000, ->
console.log '|______|___/ .__/|_| \\___||___/___/\\___/ '
console.log ' | | '
console.log ' |_| '
console.log "Server listening on port %d", app.address().port
console.log "Server listening on port %d", app.address().port

0 comments on commit e5974bd

Please sign in to comment.