Skip to content

Commit

Permalink
fix middleware check local.assets path (support load from config)
Browse files Browse the repository at this point in the history
  • Loading branch information
worker-build-deploy committed May 6, 2024
1 parent 089d724 commit 8656827
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import router from './router.js';
const middleware = async function (config) {
const app = express();

app.locals.assets = JSON.parse(fs.readFileSync('./build-assets.json'));
let assetsPath = config?.locals?.assets || './build-assets.json';
app.locals.assets = fs.existsSync(assetsPath) && JSON.parse(fs.readFileSync(assetsPath));

// Set up swig
const swigOptions = {
Expand Down

0 comments on commit 8656827

Please sign in to comment.