clientoauth2nodejs
v1.1.0
Published
## Guia para crear dependencias https://sergiodxa.com/articles/crear-modulo-npm
Downloads
32
Readme
ClientOauth2NodeJS
Guia para crear dependencias
https://sergiodxa.com/articles/crear-modulo-npm
Como usarla
const {setupInterceptorsTo} = require('clientoauth2nodejs')
const axios = require('axios');
const https = require("https");
const axiosInstance = setupInterceptorsTo(axios.create());
const httpsAgent = new https.Agent({
rejectUnauthorized: false,
});
async function makeRequest(method url, data = null) {
await axiosInstance({
method: method,
url: url,
headers:{
"Content-Type":"application/json",
},
httpsAgent: httpsAgent,
data : data? JSON.stringify(data) : null
}).then((response) =>{
console.log(response.data)
}).catch((error) => {
console.log(error)
})
}