skip to Main Content

Firebase – How to stream data to the Browser with Google Cloud Functions so that download starts immediately?

I am streaming data to the browser like this: res.writeHead(200, { 'Content-Type': 'text/event-stream', 'Content-Disposition': 'attachment; filename="data.dat"', 'Cache-Control': 'no-cache', 'Connection': 'keep-alive' }) stream1.pipe(res, {end: false)}; stream1.on('end', () => { console.log("stream 1 finished"); stream2.pipe(res, {end: false}); stream2.on('end', () => { console.log("last stream…

VIEW QUESTION

Firebase functions not loading .env file

According to the Firebase documentation, Loaded environment variables from .env. should be printed to the console when deploying functions. My functions are exported inside src/functions/functions.ts. This is specified in my package.json file: main: lib/src/functions/functions.js (since I am using TypeScript, I…

VIEW QUESTION
Back To Top
Search