admin管理员组

文章数量:1430742

Is it possible to not run the actual code on firebase database while development by firing up a local instance and developing using that, like we do for other mongodb and mysql databases?

Is it possible to not run the actual code on firebase database while development by firing up a local instance and developing using that, like we do for other mongodb and mysql databases?

Share Improve this question asked Jul 23, 2017 at 12:11 Shiven SinhaShiven Sinha 6966 silver badges15 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

You can try this module firebase-server

I built an open-source project called firebase-server to implement end-to-end tests in my own application. With firebase-server, my end-to-end tests are now running 40% faster and I no longer depend on an Internet connection for running the tests in development.

Firebase Web Socket Protocol Server. Useful for emulating the Firebase server in tests.

var FirebaseServer =     require('firebase-server');

    new FirebaseServer(5000, 'localhost.firebaseio.test', {

    states: {
        CA: 'California',
        AL: 'Alabama',
        KY: 'Kentucky'
    }
});

client side

var client =    new Firebase('ws://localhost.firebaseio.test:5000');
client.on('value', function(snap) {
    console.log('Got value: ', snap.val());
});

For more details end-to-end-testing-with-firebase-server

firebase-local-development-and-testing-in-angularfire

You can use the Firebase Local Emulator Suite:

The Firebase Local Emulator Suite is a set of advanced tools for developers looking to build and test apps locally using Cloud Firestore, Realtime Database, Cloud Functions, Cloud Pub/Sub and Firebase Hosting.

本文标签: javascriptCan I run a local version of firebase database for development purposesStack Overflow