1

So I've seen this answer Using NodeJs with Firebase - Security that talks about syncing NodeJS with the Firebase data structure.

I don't use NodeJS (being a Railo/Coldfusion developer) and was wondering if something like this is possible outside of NodeJS? Through java or maybe just using REST endpoints. Or do I have to use the original solution in the above link of separately updating the data in my webserver.

Another way of wording it is; can I make a round trip from firebase to an HTTP server that isn't nodeJS?

EDIT: To clarify, exactly what I wanted to do was have a email webservice post to the REST API of Firebase, then firebase post that to an URL on my external railo server as my users need to know when the email arrives but the server just needs to make sure it stores it.

As I understand it my best bet is to get the email webservice to post to the URL on my railo server which then posts to the REST API on firebase.

Community
  • 1
  • 1
Simeon Cheeseman
  • 1,748
  • 1
  • 13
  • 24
  • I know nothing about Firebase, but its [tag description](http://stackoverflow.com/tags/firebase/info) says _"A REST API. This can be used from any language that is capable of making HTTP requests."_ - so the answer to your question seems to be yes; you probably want [cfhttp](http://cfdocs.org/cfhttp) ? – Peter Boughton Mar 03 '13 at 22:43
  • 2
    Yeah, you can certainly use the REST API to read / write Firebase data from your server code. The one thing you'll be missing is the notifications when data changes. With the node.js client, you can subscribe for updates to data but there's no way to do that from a REST API. So if you need to know when Firebase data changes, you'll have to poll the data periodically. – Michael Lehenbauer Mar 03 '13 at 22:48
  • Thanks Michael, that clears up my confusion. – Simeon Cheeseman Mar 04 '13 at 21:03
  • @PeterBoughton - I'll reword/clarify the question as it is really a how firebase works question rather than a coldfusion functions one, but thanks anyhow. – Simeon Cheeseman Mar 04 '13 at 21:10

1 Answers1

2

Yes you can.

Firebase does not have a Coldfusion client library, so you need to use the REST APIs. You can use the REST API to read / write Firebase data from your server code.

The one thing you'll be missing is the notifications when data changes. With the node.js client, you can subscribe for updates to data but there's no way to do that from a REST API.

So if you need to know when Firebase data changes, and you're using REST, you'll have to poll the data periodically.

(Note: This is mostly copied @Michael's answer in the comments)

mimming
  • 13,974
  • 3
  • 45
  • 74
  • 1
    This is no longer the case, considering the rest api has been retired. You can however use the java sdk, but I haven't yet figured out how to query data from the firebase database via the sdk. Getting and Managing users via the java sdk is pretty easy once you get all the boilerplate in place. – Kevin B Jun 18 '18 at 21:06
  • Updated docs for the Firebase REST API: https://firebase.google.com/docs/reference/rest/database/ – JDev Dec 07 '18 at 18:40
  • @KevinB It doesn't say in the docs that the REST api is retired. Is this still true? – Patrick Schomburg Feb 28 '19 at 16:16