ccashfrontend/helpers/functions.js
2021-06-10 21:49:46 +10:00

21 lines
415 B
JavaScript

const got = require("got");
async function postUser(name, password) {
console.log(process.env.BANKAPIURL);
try {
const { body } = await got.get(
process.env.BANKAPIURL + "BankF/user/" + name,
{
headers: {
Password: password,
},
responseType: "json",
}
);
return body;
} catch (err) {
console.log(err);
}
}
module.exports = { postUser };