diff --git a/Readme.md b/Readme.md index d239758..9963736 100644 --- a/Readme.md +++ b/Readme.md @@ -13,9 +13,25 @@ You need sign-in or sign-up to Heroku. $ git push -u heroku master $ heroku open -## Deployment +## Development + +0. Install packages. + + ```sh + $ npm install + ``` + +0. Add or update files in `/public`. +0. Run on the local machine. -Add or update files in `/public`. + ```bash + $ npm start + ``` + +0. Check on browser. + - http://localhost:5000 + +## Deployment $ git add . $ git commit -a -m 'some commit message' diff --git a/package.json b/package.json index c7e7d65..095a0f2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,15 @@ "name": "heroku-static-provider", "version": "0.0.1", "private": true, + "scripts": { + "start": "nf start" + }, "dependencies": { - "express": "~3.3.4" + "compression": "~1.6.2", + "express": "~4.14.0", + "morgan": "~1.7.0" + }, + "devDependencies": { + "foreman": "~2.0.0" } } diff --git a/server.js b/server.js index e5ffd87..8ce2525 100644 --- a/server.js +++ b/server.js @@ -1,5 +1,6 @@ - var express = require('express'); +var logger = require('morgan'); +var compression = require('compression'); var app = express(); var user = process.env.USER; @@ -11,8 +12,8 @@ if (user && pass) { app.use(express.basicAuth(user, pass)); } -app.use(express.logger('dev')); -app.use(express.compress()); +app.use(logger('dev')); +app.use(compression()); app.use(express.static(__dirname + '/public')); app.listen(app.get('port'), function() {