File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+
2+
3+ export async function onDocumentReady ( ) {
4+
5+ //[START rtdb_emulator_connect]
6+ let firebaseConfig = {
7+ // Point to the RTDB emulator running on localhost.
8+ // Here we supply database namespace 'foo'.
9+ databaseURL : "http://localhost:9000?ns=foo"
10+ }
11+
12+ var myApp = firebase . initializeApp ( firebaseConfig ) ;
13+ const db = myApp . database ( ) ;
14+ // [END rtdb_emulator_connect]
15+ }
Original file line number Diff line number Diff line change 1+
2+
3+ export async function onDocumentReady ( firebaseApp ) {
4+
5+ //[START fs_emulator_connect]
6+ // firebasApp previously initialized using firebase.initializeApp()
7+ const db = firebaseApp . firestore ( ) ;
8+ if ( location . hostname === "localhost" ) {
9+ db . settings ( {
10+ host : "localhost:8081" ,
11+ ssl : false
12+ } ) ;
13+ }
14+ // [END fs_emulator_connect]
15+ }
You can’t perform that action at this time.
0 commit comments