When I'm listening on a local port with my browser, the following method will return Hello world.
//Node
app.get('/', (req,res)=>{
res.send('Hello world')
});
I've successfully exported the app as a callable cloud function named: getConstits
.
//Node
exports.getConstits = functions.https.onCall(app);
Next, I call the function in my client.
//Client
final HttpsCallable callable = CloudFunctions.instance.getHttpsCallable(
functionName: 'getConstits',
);
getElec()async {
dynamic resp = await callable.call();
print(resp);
}
However, upon calling the function, an unhandled exception is thrown. The URL generated by the cloud function responds with
{"error":{"message":"Bad Request","status":"INVALID_ARGUMENT"}}
. How can I ensure that "Hello World" is returned to the client?