Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

123456789101112131415161718192021222324252627282930313233343536
  1. if (typeof firebase === 'undefined') throw new Error('hosting/init-error: Firebase SDK not detected. You must include it before /__/firebase/init.js');
  2. /*--CONFIG--*/
  3. if (firebaseConfig) {
  4. firebase.initializeApp(firebaseConfig);
  5. /*--EMULATORS--*/
  6. if (firebaseEmulators) {
  7. console.log("Automatically connecting Firebase SDKs to running emulators:");
  8. Object.keys(firebaseEmulators).forEach(function (key) {
  9. console.log('\t' + key + ': http://' + firebaseEmulators[key].hostAndPort);
  10. });
  11. if (firebaseEmulators.database && typeof firebase.database === 'function') {
  12. firebase.database().useEmulator(firebaseEmulators.database.host, firebaseEmulators.database.port);
  13. }
  14. if (firebaseEmulators.firestore && typeof firebase.firestore === 'function') {
  15. firebase.firestore().useEmulator(firebaseEmulators.firestore.host, firebaseEmulators.firestore.port);
  16. }
  17. if (firebaseEmulators.functions && typeof firebase.functions === 'function') {
  18. firebase.functions().useEmulator(firebaseEmulators.functions.host, firebaseEmulators.functions.port);
  19. }
  20. if (firebaseEmulators.auth && typeof firebase.auth === 'function') {
  21. // TODO: Consider using location.protocol + '//' instead (may help HTTPS).
  22. firebase.auth().useEmulator('http://' + firebaseEmulators.auth.hostAndPort);
  23. }
  24. if (firebaseEmulators.storage && typeof firebase.storage === 'function') {
  25. firebase.storage().useEmulator(firebaseEmulators.storage.host, firebaseEmulators.storage.port);
  26. }
  27. } else {
  28. console.log("To automatically connect the Firebase SDKs to running emulators, replace '/__/firebase/init.js' with '/__/firebase/init.js?useEmulator=true' in your index.html");
  29. }
  30. }