Published
Edited
Feb 27, 2022
Importers
4 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof indexHtml = Inputs.bind(
Inputs.textarea({
width: "1vu",
rows: 50,
label: "[Optional] Optional index.html"
}),
localStorageView(`deploy_to_s3_index.html`)
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
uploader = {
// upload current file
const filename = files[index].name.replace("./", "");
if (filename === "index.html" && indexHtml.length > 0) {
files[index].buffer = indexHtml; // Not really a buffer but putObject accepts both
}
await putObject(bucket, path + "/" + filename, files[index].buffer, {
ContentType: mimetypes.contentType(filename)
});

if (index < files.length - 1) {
// next file
mutable index = mutable index + 1;
} else {
// done!
// Invalidate cloud front cache if needed.
if (CLOUD_FRONT_DISTRIBUTION_ID.length > 0) {
await createInvalidation(CLOUD_FRONT_DISTRIBUTION_ID, [
INVALIDATION_PATH
]);
}
mutable deployed = true;
}
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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