Added CDN thumb generation.

This commit is contained in:
Patrick Fic
2020-01-24 11:03:33 -08:00
parent 32ce90ec9c
commit 5f256c204d
4 changed files with 130 additions and 105 deletions

View File

@@ -0,0 +1,13 @@
export const generateCdnThumb = key => {
const imageRequest = JSON.stringify({
bucket: process.env.REACT_APP_S3_BUCKET,
key: key,
edits: {
resize: {
height: 100,
width: 100
}
}
});
return `${process.env.REACT_APP_S3_CDN}/${btoa(imageRequest)}`;
};