Etc

Firebase Server 연동-2

85chong 2022. 5. 16. 16:26
728x90
반응형
SMALL

main.js 파일

    
    var mData;
    
    function yckinitializeApp() {
        var firebaseConfig ={
            apiKey: "AIzaSyCbvCvI3Dpkn36pIuwdes30Vmw6ugSytao",
            authDomain: "temptestserver.firebaseapp.com",
            databaseURL: "https://temptestserver-default-rtdb.firebaseio.com",
            projectId: "temptestserver",
            storageBucket: "temptestserver.appspot.com",
            messagingSenderId: "582158887911",
            appId: "1:582158887911:web:e8f9d55e624eeecbe22b42",
            measurementId: "G-J9FHYD2DNK"
        };
        firebase.initializeApp(firebaseConfig);
    }        

    function getDataBaseData(){
        var ref = firebase.database().ref();
        ref.on('value', function(snapshot) {
            mData = snapshot.val();
            console.log(mData);
        }, function (error) {
            console.log("Error: " + error.code);
        });
    }
    
    // server -> App
    function reqUserInfo(){

    }

    yckinitializeApp();

    getDataBaseData();