(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
import java.io.ByteArrayOutputStream | |
import java.io.File | |
import java.nio.charset.StandardCharsets.UTF_8 | |
import java.util.zip.GZIPInputStream | |
import java.util.zip.GZIPOutputStream | |
fun gzip(content: String): ByteArray { | |
val bos = ByteArrayOutputStream() | |
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(content) } | |
return bos.toByteArray() |
/* Firebase Functions messes with your request and will wreck your day because none of the | |
* traditional upload handlers with Express will work. | |
* | |
* Credit: https://stackoverflow.com/questions/47242340/how-to-perform-an-http-file-upload-using-express-on-cloud-functions-for-firebase | |
*/ | |
const Busboy = require('busboy'); | |
const allowedMethods: string[] = ['POST', 'PUT']; | |
export class FileUpload { |