put everything in a static directory

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.
This commit is contained in:
Ben West
2014-06-25 14:15:36 -07:00
parent 3555f733c8
commit 59b7bca95b
14 changed files with 9 additions and 2 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"directory": "./static/bower_components"
}
+4 -1
View File
@@ -3,4 +3,7 @@ node_modules/
.idea/
*.iml
my.env
my.env
*.env
static/bower_components/
.*.sw?
+2 -1
View File
@@ -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,
View File

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 318 B

Before

Width:  |  Height:  |  Size: 883 KiB

After

Width:  |  Height:  |  Size: 883 KiB

View File