I have an existing Firebase application (Which was built for quick prototyping and which is now grown big, I don't intend to move because existing dependencies and also because ease of use and authentication tied up) and I am trying to build a Rest API using FeatherJS.
It seems it is really easy to work with FeathersJS if you are using a standard database (MongoDB, etc). How can I integrate Firebase with Feathers keeping the best practices in place (Service Architecture, AOP)? Can I override service in Feathers and map it to my Firebase Rest endpoint?
I created a custom service in Feathers and tried doing this :
get(id, params) {
return Promise.resolve(FirebaseRef.child(id).once('value'));
}
I get the:
Converting circular structure to JSON error
Is what I am doing correct?
This worked :
return Promise.resolve(FirebaseRef.child('userId1').once('value').then(function (snap) {
return snap.val();
}));
I am still unsure if this is how I would best integrate Firebase with FeathersJs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With