Skip to content

Commit

Permalink
put everything in a static directory
Browse files Browse the repository at this point in the history
Tested by deleting everything, running npm install from scratch.
This helps ensure that only the files in the static subdirectory can be served.
Should eliminate serving config files via http.
  • Loading branch information
bewest committed Jun 25, 2014
1 parent 3555f73 commit 59b7bca
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory": "./static/bower_components"
}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ node_modules/

.idea/
*.iml
my.env
my.env
*.env
static/bower_components/
.*.sw?
3 changes: 2 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ var app = express();
app.set('title', 'Nightscout');

// define static server
var server = express.static(__dirname);
var staticDir = __dirname + '/static/';
var server = express.static(staticDir);
app.use(function(req, res, next) {
res.set({
"Cache-Control": "public, max-age=" + THIRTY_DAYS,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 59b7bca

Please sign in to comment.