Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Express v4 and foreman #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
7 changes: 4 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

var express = require('express');
var logger = require('morgan');
var compression = require('compression');
var app = express();

var user = process.env.USER;
Expand All @@ -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() {
Expand Down