I tried to copy exactly the same style as the guy in this video does:
https://youtu.be/7IkUgCLr5oA?t=259
Here's my version (mine is JS, his is TS):
exports.upload = functions.https.onRequest((req,res) => {
cors(req, res, () => {});
const pr = new Promise((resolve,reject)=> {
form = formidable()
form.parse(req, (err,fields,files) => {
resolve(files.toString())
});
});
pr.then(data=>res.send(data));
});
});
My code just lags until the response times out. Any ideas why? I've tried all sorts of other ways, without using the Promise, but nothing works.
resolve('asdasd')
, doesn't help. – geokavelpr.then(data=>res.send(data)).catch(error => {console.log(error); });
. You should see the output in the Firebase console. – Renaud Tarnec