Initial Commit
This commit is contained in:
22
JS/gestiondb.mjs
Normal file
22
JS/gestiondb.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-app.js";
|
||||
import { getFirestore, getDocs, collection, addDoc, setDoc, deleteDoc, doc, query, where } from "https://www.gstatic.com/firebasejs/10.7.1/firebase-firestore.js"
|
||||
|
||||
|
||||
const firebaseConfig = {
|
||||
apiKey: "AIzaSyCj4QvZVKS8hH-QfIH_DsAM0MRvamd7LbA",
|
||||
authDomain: "webforja-31b8b.firebaseapp.com",
|
||||
projectId: "webforja-31b8b",
|
||||
storageBucket: "webforja-31b8b.appspot.com",
|
||||
messagingSenderId: "294376462200",
|
||||
appId: "1:294376462200:web:98d4daceb731ab1b57da8d",
|
||||
measurementId: "G-MCR5EEE6GK"
|
||||
};
|
||||
// Initialize Firebase
|
||||
const app = initializeApp(firebaseConfig);
|
||||
|
||||
const db = getFirestore(app);
|
||||
const prueba = collection(db, "productos");
|
||||
const snapshotProductos = await getDocs(prueba);
|
||||
const productos = snapshotProductos.docs
|
||||
|
||||
console.log(snapshotProductos)
|
||||
Reference in New Issue
Block a user