How do I make an API request through Node.JS?
In Zoho creator, I created a function that uses nodeJS. In the function, I'm making an API call to an outside URL using a fetch request. The problem is that whenever I run it, it says that "fetch" is not a function at module.exports. I've also tried it with an axios request but that doesn't work either. I see that there's a node_modules folder so I'm trying to put the axios module inside but it only allows me to upload files and not entire folders. How do I go about making an API call in NodeJS (in Zoho creator)?
- module.exports = async function (context, basicIO )
- {
- const baseURL = basicIO.getParameter("URL");
- axios(baseURL)
- .then(resp => resp.json())
- .then(data =>
- basicIO.write(data)
- );
- }