Shiven Sinha
Shiven Sinha

Reputation: 696

Can I run a local version of firebase database for development purposes?

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?

Upvotes: 4

Views: 6361

Answers (2)

yuri
yuri

Reputation: 191

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.

Upvotes: 1

Adiii
Adiii

Reputation: 60074

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

Upvotes: 2

Related Questions