in scripts/fixtures/fixtures-server.js [68:89]
async function (req, res) {
const path = req.params[0];
const fixtureQuery = req.query['fixture'];
const fixture = JSON.parse(
Buffer.from(fixtureQuery, 'base64').toString(),
);
// Fetch the JSON for the given path from PROD Frontend
const dataModel = await fetchDcrDataModel(path, req.headers);
if (!dataModel) {
console.error(
'Something went wrong retrieving DCR data from PROD',
);
return res.status(503).send();
}
// Merge the fixture into the data model
// Note that this will be a deep merge
merge(dataModel, fixture);
return res.json(dataModel);
},