Skip to content

Instantly share code, notes, and snippets.

@jirawatee
Created May 25, 2020 14:29
Show Gist options
  • Save jirawatee/8b4c08055c9f3bdf86276192daefd0f3 to your computer and use it in GitHub Desktop.
Save jirawatee/8b4c08055c9f3bdf86276192daefd0f3 to your computer and use it in GitHub Desktop.
Resize image by Firebase Extensions - 4
let prefix = `https://firebasestorage.googleapis.com/v0/b/${bucket.name}/o`
let suffix = `alt=media&token=${uuid}`
return {
original: `${prefix}/${encodeURIComponent(file[0].name)}?${suffix}`,
thumb: `${prefix}/photos${encodeURIComponent(`/${event.source.userId}/thumbs/${event.timestamp}_200x200.jpg`)}?${suffix}`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment