Published
Edited
Feb 4, 2022
Importers
19 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof myBucket = await bucket({
name: "mybucket11",
location: "europe-west4",
// status: "deleted",
})
Insert cell
Insert cell
Insert cell
Insert cell
storage = storageClient("gs://o_endpointservices_mybucket11")
Insert cell
Insert cell
developerGif = storage.ref("/public/developers.gif").getDownloadURL()
Insert cell
// Developers developers developers developers...
html`<img src=${developerGif}>`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
html`<input type="file" onchange=${(evt)=> {
const file = evt.target.files[0];
return storage.ref(`/public/${file.name}`).put(file);
}}>`
Insert cell
Insert cell
Insert cell
// If you had logged in as me, you could download this, by default, domain owners have all permissions
storage.ref("/foo").getDownloadURL()
Insert cell
Insert cell
(await storage.ref("/public").listAll()).items.map(item => item.name)
Insert cell
Insert cell
Insert cell
defaultRules = `rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if '${subdomain()}' in request.auth.token['observablehq.com'];
}
match /public/{allPaths=**} {
allow get;
}
}
}
`
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
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