Skip to content

Commit 1002d84

Browse files
committed
update to express v4
see nulltask/heroku-static-provider#1
1 parent ad17248 commit 1002d84

File tree

3 files changed

+65
-4
lines changed

3 files changed

+65
-4
lines changed

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
11
# secret-page
22
Super Duper Secret Stuff
3+
4+
Based on https://github.com/nulltask/heroku-static-provider
5+
6+
## Installation
7+
8+
You need sign-in or sign-up to Heroku.
9+
10+
$ git clone [email protected]:keckelt/secret-page.git
11+
$ cd secret-page
12+
$ heroku create
13+
$ git push -u heroku master
14+
$ heroku open
15+
16+
## Development
17+
18+
0. Install packages.
19+
20+
```sh
21+
$ npm install
22+
```
23+
24+
0. Add or update files in `/public`.
25+
0. Run on the local machine.
26+
27+
```bash
28+
$ npm start
29+
```
30+
31+
0. Check on browser.
32+
- http://localhost:5000
33+
34+
## Deployment
35+
36+
$ git add .
37+
$ git commit -a -m 'some commit message'
38+
$ git push heroku master
39+
$ heroku open
40+
41+
## Notes
42+
43+
### Adding Basic Auth
44+
45+
$ heroku config:set USER=username
46+
$ heroku config:set PASS=password
47+
48+
### Screencast
49+
50+
* https://vimeo.com/71315109
51+
52+
## License
53+
54+
MIT

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,15 @@
22
"name": "secret-page",
33
"version": "0.0.1",
44
"private": true,
5+
"scripts": {
6+
"start": "nf start"
7+
},
58
"dependencies": {
6-
"express": "~3.3.4"
9+
"compression": "^1.7.4",
10+
"express": "^4.17.3",
11+
"morgan": "1.^10.0"
12+
},
13+
"devDependencies": {
14+
"foreman": "~2.0.0"
715
}
816
}

server.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
21
var express = require('express');
2+
var logger = require('morgan');
3+
var compression = require('compression');
34
var app = express();
45

56
var user = process.env.USER;
@@ -11,8 +12,8 @@ if (user && pass) {
1112
app.use(express.basicAuth(user, pass));
1213
}
1314

14-
app.use(express.logger('dev'));
15-
app.use(express.compress());
15+
app.use(logger('dev'));
16+
app.use(compression());
1617
app.use(express.static(__dirname + '/public'));
1718

1819
app.listen(app.get('port'), function() {

0 commit comments

Comments
 (0)