Skip to content

Commit

Permalink
update to express v4
Browse files Browse the repository at this point in the history
  • Loading branch information
keckelt committed Mar 14, 2022
1 parent ad17248 commit 1002d84
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 4 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,54 @@
# secret-page
Super Duper Secret Stuff

Based on https://github.com/nulltask/heroku-static-provider

## Installation

You need sign-in or sign-up to Heroku.

$ git clone [email protected]:keckelt/secret-page.git
$ cd secret-page
$ heroku create
$ git push -u heroku master
$ heroku open

## Development

0. Install packages.

```sh
$ npm install
```

0. Add or update files in `/public`.
0. Run on the local machine.

```bash
$ npm start
```

0. Check on browser.
- http://localhost:5000

## Deployment

$ git add .
$ git commit -a -m 'some commit message'
$ git push heroku master
$ heroku open

## Notes

### Adding Basic Auth

$ heroku config:set USER=username
$ heroku config:set PASS=password

### Screencast

* https://vimeo.com/71315109

## License

MIT
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": "secret-page",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "nf start"
},
"dependencies": {
"express": "~3.3.4"
"compression": "^1.7.4",
"express": "^4.17.3",
"morgan": "1.^10.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

0 comments on commit 1002d84

Please sign in to comment.