最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Can I run a local version of firebase database for development purposes? - Stack Overflow

programmeradmin0浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论