function buildPublicFileUrl(req, relativePath) {
  const protocol = req.protocol;
  const host = req.get('host');
  return `${protocol}://${host}/${relativePath.replace(/\\/g, '/')}`;
}

module.exports = {
  buildPublicFileUrl,
};