Call Firebase cloud function via GET and return parameters

I have created this cloud function:

exports.returnUid = functions.https.onRequest(async(req, res) => {
    const uid = req.query.uid
    res.send(uid)
});

When I call https://<project>.cloudfunctions.net/returnUid?uid=123abc, it returns an empty response, and not the "uid" parameter as it should.

Answers:

Answer

I've found out that when using firebase --serve, the function won't acept parameters. But when I deplpoy it, it does.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us Javascript

©2020 All rights reserved.