CachingMiddleware: Asyncify

This commit is contained in:
Richard Hansen 2021-02-27 00:08:29 -05:00 committed by webzwo0i
parent 0284d49522
commit f86df5322e
2 changed files with 99 additions and 112 deletions

View file

@ -31,7 +31,7 @@ const getTar = async () => {
exports.expressCreateServer = async (hookName, args) => {
// Cache both minified and static.
const assetCache = new CachingMiddleware();
args.app.all(/\/javascripts\/(.*)/, assetCache.handle);
args.app.all(/\/javascripts\/(.*)/, assetCache.handle.bind(assetCache));
// Minify will serve static files compressed (minify enabled). It also has
// file-specific hacks for ace/require-kernel/etc.