|
|
@ -5,6 +5,8 @@ const ensureAdmin = require('./middleware/ensureAdmin')
|
|
|
|
router.get('/:uuid/:size', async (req, res) => {
|
|
|
|
router.get('/:uuid/:size', async (req, res) => {
|
|
|
|
const image = await db.item.getImage(req.params.uuid, req.params.size)
|
|
|
|
const image = await db.item.getImage(req.params.uuid, req.params.size)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const cacheSeconds = 60 * 60 * 24;
|
|
|
|
|
|
|
|
res.set('Cache-Control', cacheSeconds);
|
|
|
|
res.set('Content-Type', image.mime_type)
|
|
|
|
res.set('Content-Type', image.mime_type)
|
|
|
|
res.end(image.file)
|
|
|
|
res.end(image.file)
|
|
|
|
})
|
|
|
|
})
|
|
|
|