Files
rowy/ft_build/extensionsLib/apiCall.ts
2021-07-09 22:31:42 +10:00

12 lines
318 B
TypeScript

export const dependencies = {
"node-fetch": "2.6.1",
};
const api = async (args) => {
const { body, url, method, callback } = args;
const fetch = require("node-fetch");
return fetch(url, { method: method, body: body })
.then((res) => res.json())
.then((json) => callback(json));
};
export default api;