|
|
|
|
|
by rikelmens
1219 days 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. |
|