Added a try catch block to deblock api requests

This commit is contained in:
Gilles Lazures 2026-02-11 01:05:22 +01:00
parent 5eaca1e948
commit 7e9496b35d

View File

@ -3,8 +3,12 @@ const metaService = require("../services/metaService")
const router = express.Router({ mergeParams: true })
router.get(/.*/, async (req, res, next) => {
const file = metaService.serveStaticFile(req.originalUrl)
return res.status(200).sendFile(file)
try {
const file = metaService.serveStaticFile(req.originalUrl)
return res.status(200).sendFile(file)
} catch (error) {
next()
}
})
module.exports = router