The only tool you need to know what is happening and how to fix it.
Go alertingexception-trackerissue-trackinglogsmetricsmonitoringobservability-platformopen-telemetryotelsession-replaytelemetrytraces
'use strict';
async function request(base, method, path, body) {
const res = await fetch(base + path, {
method,
headers: { accept: 'application/json', ...(body ? { 'content-type': 'application/json' } : {}) },
body: body ? JSON.stringify(body) : undefined,
});
if (!res.ok) {
throw new Error(`${method} ${base}${path} answered ${res.status}`);
}
return res.json();
}
module.exports = { request };