Skip to content

Commit dada09c

Browse files
committed
Initial commit
0 parents  commit dada09c

File tree

6 files changed

+77
-0
lines changed

6 files changed

+77
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
/node_modules

Procfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
web: node server

Readme.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Heroku Static Provider
2+
3+
Static site provider for Heroku.
4+
5+
6+
## Installation
7+
8+
You need sign-in or sign-up to Heroku.
9+
10+
$ git clone https://github.com/nulltask/heroku-static-provider.git my-site
11+
$ cd my-site
12+
$ heroku create
13+
$ git push -u heroku master
14+
$ heroku open
15+
16+
## Deployment
17+
18+
Add or update files in `/public`.
19+
20+
$ git add .
21+
$ git commit -a -m 'some commit message'
22+
$ git push heroku master
23+
$ heroku open
24+
25+
## Notes
26+
27+
### Adding Basic Auth
28+
29+
$ heroku config:set USER=username
30+
$ heroku config:set PASS=password
31+
32+
### Screencast
33+
34+
* https://vimeo.com/71315109
35+
36+
## License
37+
38+
MIT

package.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "heroku-static-provider",
3+
"version": "0.0.1",
4+
"private": true,
5+
"dependencies": {
6+
"express": "~3.3.4"
7+
}
8+
}

public/index.html

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head></head>
4+
<body>
5+
<h1>Hello world</h1>
6+
</body>
7+
</html>

server.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
var express = require('express');
3+
var app = express();
4+
5+
var user = process.env.USER;
6+
var pass = process.env.PASS;
7+
8+
app.set('port', process.env.PORT || 3000);
9+
10+
if (user && pass) {
11+
app.use(express.basicAuth(user, pass));
12+
}
13+
14+
app.use(express.logger('dev'));
15+
app.use(express.compress());
16+
app.use(express.static(__dirname + '/public'));
17+
18+
app.listen(app.get('port'), function() {
19+
console.log('Server listening on port %s', app.get('port'));
20+
});

0 commit comments

Comments
 (0)