I get the folowing error in the Firebase console : Function execution took 60015 ms. Finished with status: timeout.
Here is my Cloud Function :
exports.test = functions.https.onRequest((req, res) => {
cors(req, res, () => {
const Number = req.body.Number;
return axios.post('https://ws.orias.fr/service?wsdl',
getXMLNS(Number), {
headers:
{ 'Content-Type': 'text/xml' },
},
)
.then((res) => {
return res.status(200).send(res);
}).catch((error) => (error) => {
return res.status(500).send(error);
});
});
});
And here is how I call this Cloud Function in my ReactJS Frontend :
fetch('https://xxx.cloudfunctions.net/test', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
Number: 'xxx',
})
}).then(res => res.json()).then(body => alert(JSON.stringify(body)));