Published
Edited
Apr 27, 2020
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
makeAPI = function (baseUrl, hash = HASH) {
return {
request: function (path, options, root) {
const formData = new FormData();
Object.entries({ hash, ...options }).forEach(([key, value]) => {
if (value instanceof dayjs) {
value = value.format('YYYY-MM-DD HH:mm:ss')
}
formData.append(key, value)
})
return fetch(baseUrl + '/' + path, {
method: 'POST',
body: formData
})
.then(r => r.json())
.then(json => root ? json[root] : json)
}
}
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more