mirror of
https://github.com/luxfi/pics.git
synced 2026-10-30 15:22:15 +00:00
25 lines
451 B
JavaScript
25 lines
451 B
JavaScript
'use strict';
|
|
|
|
const { buildBypass } = require(__dirname+'/../../lib/build/tasks.js');
|
|
|
|
module.exports = async (req, res, next) => {
|
|
|
|
if (res.locals.minimal === true) {
|
|
return res
|
|
.set('Cache-Control', 'public, max-age=60')
|
|
.render('bypass', {
|
|
minimal: true
|
|
});
|
|
}
|
|
|
|
let html;
|
|
try {
|
|
html = await buildBypass(res.locals.minimal);
|
|
} catch (err) {
|
|
return next(err);
|
|
}
|
|
|
|
return res.set('Cache-Control', 'max-age=0').send(html);
|
|
|
|
};
|