diff --git a/README.md b/README.md index 5c1b24d..5595316 100644 --- a/README.md +++ b/README.md @@ -2,5 +2,9 @@ Generate the CSS for a tooltip arrow. Check it out at http://cssarrowplease.com +## Contributing +You can simply open the public/index.html file in your browser +or start the development node app (not required): `node bin/server --development` + ## License CSSArrowPlease is Copyright © 2012 Simon Højberg. CSSArrowPlease is free software, and may be redistributed under the terms specified in the LICENSE file. diff --git a/bin/server b/bin/server index 26c676f..f1ef1b5 100644 --- a/bin/server +++ b/bin/server @@ -1,8 +1,18 @@ #!/usr/bin/env node var connect = require('connect'), - http = require('http'); + http = require('http'), + port = process.env.PORT || 3000, + static; -var app = connect().use(connect.static('public-min', { maxAge: 365 * 24 * 60 * 60 * 1000})); +if (process.argv.indexOf('--development') !== -1) { + console.log('CSS Arrow Please in development on http://localhost:' + port); + static = connect.static('public'); +} +else { + static = connect.static('public-min', { + maxAge: 365 * 24 * 60 * 60 * 1000 + }); +} -http.createServer(app).listen(process.env.PORT || 3000); +http.createServer( connect().use( static ) ).listen( port );