Skip to content

๐Ÿ”ฅ Firebase

Firebase local hosting

Quote

Firebase Hosting reserves URLs in your site beginning with /__. This reserved namespace makes it easier to use other Firebase products together with Firebase Hosting.
These reserved URLs are available both when you deploy to Firebase (firebase deploy) or when you run your app on a local server (firebase serve).

<!-- Insert these scripts at the bottom of the HTML, but before you use any Firebase services -->
<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
<script src="/__/firebase/x.y.z/firebase-app.js"></script>

<!-- Add Firebase products that you want to use -->
<script src="/__/firebase/x.y.z/firebase-auth.js"></script>
<script src="/__/firebase/x.y.z/firebase-firestore.js"></script>

<!-- Load the Firebase SDKs before loading this file -->
<script src="/__/firebase/init.js"></script>

๐Ÿ”— ๐Ÿ”—

Backup & Restore

  • Backup
    gsutil -m cp -R gs://xyz.appspot.com .
    firebase database:get / --pretty > xyz.json
    
  • Restore
    gsutil -m cp -R . gs://xyz.appspot.com
    firebase database:set / xyz.json