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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more