Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.helloWorld = function helloWorld(req, res) {
- if (req.body.message === undefined) {
- res.status(400).send('No message defined!');
- } else {
- const zlib = require('zlib');
- // Obtain JSON stream from your source...
- res.writeHead(200, {
- 'content-encoding': 'gzip',
- });
- json.pipe(zlib.createGzip()).pipe(res);
- }
- };
Add Comment
Please, Sign In to add comment