mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-20 15:36:16 -04:00
update for express 4.x
This commit is contained in:
parent
7b86eb09bc
commit
d0b39c01fb
8 changed files with 25 additions and 24 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue