gpt4 book ai didi

javascript - 我可以出于开发目的运行本地版本的 firebase 数据库吗?

转载 作者:搜寻专家 更新时间:2023-10-31 23:51:30 24 4
gpt4 key购买 nike

是否可以在开发时通过启动本地实例并使用它进行开发而不在 firebase 数据库上运行实际代码,就像我们对其他 mongodb 和 mysql 数据库所做的那样?

最佳答案

你可以试试这个模块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'
}
});

客户端

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

更多详情 end-to-end-testing-with-firebase-server

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

关于javascript - 我可以出于开发目的运行本地版本的 firebase 数据库吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45264940/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com