ghc-db
Version:
This module helps you to work with GH_DB
20 lines (19 loc) • 429 B
JavaScript
const axios = require('axios');
const requestFunc = async(url, data) => {
const config = {
method: 'POST',
url: url,
headers: {
'Content-Type': 'application/json'
},
data : data
};
try {
const response = await axios(config);
return response.data;
} catch (err) {
return err.response.data;
}
}
//exports
module.exports = requestFunc;