Skip to content

Commit c5bbd98

Browse files
committed
Merge pull request hojberg#26 from hojberg/development_mode
Added a simple way to run the node app in dev
2 parents 4cdd01e + 22897f0 commit c5bbd98

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
Generate the CSS for a tooltip arrow.
33
Check it out at http://cssarrowplease.com
44

5+
## Contributing
6+
You can simply open the public/index.html file in your browser
7+
or start the development node app (not required): `node bin/server --development`
8+
59
## License
610
CSSArrowPlease is Copyright © 2012 Simon Højberg. CSSArrowPlease is free software, and may be redistributed under the terms specified in the LICENSE file.

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)