Jule Wolf
Jule Wolf

Reputation: 221

How and where to implement REST API with Firebase

After some research for a tutorial about implementing REST APIs with Firebase, everything I could find was the code snippets with the curl (or other help libs) method calls. But I could not find anything about the basics like where do I have to call those methods, how do I connect the different things etc..

What do I need this for:

I'm programming an WebApp with the Ionic Framework, HTML5 and JavaScript and I needed to store some data in a backend, so I choosed Firebase since the reviews were pretty good.

What I want to do:

I need to query my (already existing) data in Firebase with a variable I have calculated in a JS file and return the result to the same JS file for further calculations. I would preferably use the python lib https://github.com/thisbejim/Pyrebase recommended on the Firebase REST API tutorial page https://firebase.google.com/docs/database/rest/start since I've got some pre-knowledge there.

My question:

Where do I implement that REST API with a python script ? Do I have to create a .py file, include it into the index.html, write the methods in there and somehow call it in my JS file ? I literally have no idea about that.

Any kind of help is highly appreciated !

Best regards, jule

Upvotes: 1

Views: 2436

Answers (1)

If all you need to do is have your JavaScript read and write data from the Firebase database then you don't need to use the REST API or implement anything in Python.

Instead you should be able to use the Firebase JavaScript interface to talk directly to the database from your JavaScript code. You can get started by following the instructions at

Firebase: Installation & Setup in JavaScript

Upvotes: 2

Related Questions