mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-16 16:19:48 -05:00
To avoid JSLint warning on var path being assigned but never used (it's used in eval()), putting a rather ugly solution directly into the the 'resolve' property of the routes.json
This commit is contained in:
parent
393552bd46
commit
2e1cd7b7d7
2 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,5 @@
|
|||
var compression = require('compression');
|
||||
var express = require('express');
|
||||
var path = require('path');
|
||||
|
||||
var handler = require('./handler');
|
||||
var log = require('./log');
|
||||
|
@ -16,9 +15,9 @@ app.use(compression());
|
|||
for (var item in routes) {
|
||||
var route = routes[item];
|
||||
if ( route.static ) {
|
||||
app.use( express.static( eval( route.resolve ), route.attributes ) );
|
||||
app.use( express.static( eval( route.resolve ), route.attributes ) );
|
||||
} else {
|
||||
app.get(route.pattern, handler(route));
|
||||
app.get(route.pattern, handler(route));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
},
|
||||
{
|
||||
"static": true,
|
||||
"resolve": "path.resolve(__dirname, '../build')",
|
||||
"resolve": "(function(){ var path = require('path'); return(path.resolve(__dirname, '../build'));})()",
|
||||
"attributes": { "lastModified": true, "maxAge": "1y" },
|
||||
"_todo": " TODO: Define a specification for how each entry is used/expected to look like, given the nginx conf generator's needs and stand-alone run-time needs. An outline of this so far: static requires resolve/attributes but could use pattern too. ..."
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue