You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/hydro/lib/axios.js

24 lines
430 B
JavaScript

const axios = require('axios');
async function get(url, options) {
let res;
try {
res = await axios.get(url, options);
} catch (e) {
res = e;
}
return res;
}
async function post(url, data, options) {
let res;
try {
res = await axios.post(url, data, options);
} catch (e) {
res = e;
}
return res;
}
global.Hydro.lib.axios = module.exports = { get, post };