const moment = require("moment");
const got = require("got");
async function fetch() {
const res = await got('https://google.com');
const headers = JSON.stringify(res.body);
return headers;
}
exports.endpoint = async function(request, response) {
response.setHeader("Content-Type", "text/plain");
response.end(await fetch());
// response.end(res.body);
}
// fetch()
// .then((res) => console.log('fetch', res))
// .catch(console.error);