2018-06-26 03:42:30 +02:00
|
|
|
const { sendGAServeEvent } = require('../../../utils/googleAnalytics');
|
|
|
|
const getClaimIdAndServeAsset = require('../utils/getClaimIdAndServeAsset.js');
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
route to serve an asset directly
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
const serveAsset = ({ headers, ip, originalUrl, params: { claimName, claimId } }, res) => {
|
|
|
|
// send google analytics
|
|
|
|
sendGAServeEvent(headers, ip, originalUrl);
|
2018-06-26 03:51:54 +02:00
|
|
|
// get the claim Id and then serve the asset
|
2018-10-25 00:11:52 +02:00
|
|
|
getClaimIdAndServeAsset(null, null, claimName, claimId, originalUrl, ip, res, headers);
|
2018-06-26 03:42:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = serveAsset;
|