top | item 34872816

(no title)

rikelmens | 3 years ago

Take a look at firebase storage, very easy to use: https://firebase.google.com/docs/storage/web/upload-files#we...

You can leave the bucket fully redable / writable by anyone, or limit who can do what.

Player A would upload the JSON to it and get the shareable URL: ================================================================== import { getStorage, ref, uploadString } from "firebase/storage"; const storage = getStorage(); const storageRef = ref(storage, 'some-child');

const state = '{foo:bar}'; uploadString(storageRef, state) .then((snapshot) => { console.log('Uploaded the state!'); return snapshot.ref.getDownloadURL(); }) .then((url) => { console.log(`Shareable state url: + ${url}`); }) ====================================================

And Player B would simply HTTP GET the shared URL.

discuss

order

No comments yet.