Skip to content

Commit

Permalink
Update inbound-integration.js
Browse files Browse the repository at this point in the history
  • Loading branch information
420neshot authored Jul 2, 2024
1 parent 1362b1b commit 9c65904
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions content-by-language/node/inbound-integration.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
const axios = require('axios');

const instance = axios.create({
baseURL: '{VAULT_URL}',
headers: {
'Content-Type': 'application/json',
},
});

async function getData() {
let result;

try {
result = await axios.post('{VAULT_URL}/post', {
account_number: 'ACC00000000000000000',
}, {
headers: { 'Content-Type': 'application/json' },
const response = await instance.post('/post', {
account_number: 'ACC00000000000000000',
});
} catch (e) {
console.error(e);
}

return result.data;
console.log('Response data:', response.data);
return response.data;
} catch (error) {
console.error('Error caught during request:', error.message);
throw error;
}
}

getData().then(response => console.log(response));
getData().then(response => console.log('Post request via proxy succeeded.'));

0 comments on commit 9c65904

Please sign in to comment.