Fetch and http function

Hello wixxin’ people.
I am creating an http_function to be called by nodejs server. Its main use is to periodically update my database on wix.
Inside the function i am making a fetch call for a 3rd party api. It seems that this is where my code get stuck. Is it possible to perform fetch inside an http function?

Also, how would you suggest i debug this file?(my only tool now is the “return” of the function)

Hi,
You can use the fetch API inside the HTTP functions . You can test the get and post functions using the postman Chrome extension .

Tal

How do you make a fetch post request with params to an external api ?

You can check the fetch API documentation. The method, in this case, should be “POST” . I recommend also reading the MDN documentation of the fetch API.

Best,
Tal.