So I'm trying to get an auth token using got.js ("got": "^12.5.1"), but can't find much documentation. I'm sort of floundering here. Any examples out there? Here's what I have so far:
'use strict';
const applicationJson = 'application/json';
const got = require('got');
module.exports = {
getAuth: async function () {
return await got.post(`https://yaddayaddayadda/fact`,{
method: 'POST',
json: {
username: 'foo',
password: 'bar',
},
responseType: 'json'
}).json();
}
}