Skip to content

Commit 3f42200

Browse files
committed
Added a simple way to run the node app in dev
Run `node bin/server --development` to start the app in development mode
1 parent 4cdd01e commit 3f42200

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

bin/server

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
#!/usr/bin/env node
22

33
var connect = require('connect'),
4-
http = require('http');
4+
http = require('http'),
5+
port = process.env.PORT || 3000,
6+
static;
57

6-
var app = connect().use(connect.static('public-min', { maxAge: 365 * 24 * 60 * 60 * 1000}));
8+
if (process.argv.indexOf('--development') !== -1) {
9+
console.log('CSS Arrow Please in development on http://localhost:' + port);
10+
static = connect.static('public');
11+
}
12+
else {
13+
static = connect.static('public-min', {
14+
maxAge: 365 * 24 * 60 * 60 * 1000
15+
});
16+
}
717

8-
http.createServer(app).listen(process.env.PORT || 3000);
18+
http.createServer( connect().use( static ) ).listen( port );

0 commit comments

Comments
 (0)