-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path71-main.js
40 lines (33 loc) · 916 Bytes
/
71-main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Initialize Firebase
var config = {
apiKey: "AIzaSyA5LntlBa1ColcieGkx9DfjrGaNw72BBY4",
authDomain: "vue-wmedia-curso.firebaseapp.com",
projectId: "vue-wmedia-curso",
/*databaseURL: "https://vue-wmedia-curso.firebaseio.com",
storageBucket: "vue-wmedia-curso.appspot.com",
messagingSenderId: "652651855856"*/
};
firebase.initializeApp(config);
// Initialize Cloud Firestore through Firebase
var db = firebase.firestore();
console.log(db); // "[DEFAULT]"
// You can retrieve services via the defaultApp variable...
db.collection("users").add({
first: "Daniel",
last: "Serna",
born: 1984
})
.then(function(docRef) {
console.log("Document written with ID: ", docRef.id);
})
.catch(function(error) {
console.error("Error adding document: ", error);
});
new Vue({
el: '#app',
data: {
mensaje: "Ya se ha enviado los datos correspondientes"
},
methods: {
}
});