diff options
Diffstat (limited to 'src/node/hooks/express/static.js')
-rw-r--r-- | src/node/hooks/express/static.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/node/hooks/express/static.js b/src/node/hooks/express/static.js index e5a2bff0..7ae20db2 100644 --- a/src/node/hooks/express/static.js +++ b/src/node/hooks/express/static.js @@ -9,11 +9,11 @@ exports.expressCreateServer = function (hook_name, args, cb) { // Cache both minified and static. var assetCache = new CachingMiddleware; - args.app.all('/(javascripts|static)/*', assetCache.handle); + args.app.all(/\/(javascripts|static)\/(.*)/, assetCache.handle); // Minify will serve static files compressed (minify enabled). It also has // file-specific hacks for ace/require-kernel/etc. - args.app.all('/static/:filename(*)', minify.minify); + args.app.all('/static/:filename', minify.minify); // Setup middleware that will package JavaScript files served by minify for // CommonJS loader on the client-side. @@ -30,7 +30,8 @@ exports.expressCreateServer = function (hook_name, args, cb) { Yajsml.associators.associationsForSimpleMapping(minify.tar); var associator = new StaticAssociator(associations); jsServer.setAssociator(associator); - args.app.use(jsServer); + + args.app.use(jsServer.handle.bind(jsServer)); // serve plugin definitions // not very static, but served here so that client can do require("pluginfw/static/js/plugin-definitions.js"); |