Reputation: 1654
I'm wanting to host an angular app that can interact with a DB. I've recently discovered firebase and was able to deploy an Angular app onto hosting pretty easily. Now, I want to find a way to allow that angular app to use data from my firebase DB. But I'm not sure what's the best way to go about doing this.
I've made REST APIs before (never deployed), so I was able to whip up a GoLang API, but afterward realized I couldn't host that on firebase (I think?). Then I followed a tutorial and built an "API" using cloud function (with hosting), and when I came to the point of deploying it, found out that this requires the paid plan. I want to be able to ensure that my apps can do what I need before paying (because I've made that mistake before), and the "pay-as-you-go" plan sounds risky to me because there are no limits (I'd rather just pay a set price). The apps I'm releasing will probably only be used by me, I just want to experience of hosting an app.
So, basically, if there a way to get my angular app to use the data in my firebase DBs without cloud functions?
I think that you can use cloud functions with the free plan, but not with Node.js (I see a note on the plan details saying *Node.js 10 runtime requires Blaze plan) Can I have a hosted API without Node.js?
Upvotes: 0
Views: 44
Reputation: 599571
Applications that use Firebase typically talk directly from the client-side code to the database. You can use server-side code too, but for many use-cases it is feasible to interact with Firebase directly from the app, and use Firebase's server-side security rules to ensure users can only read/write data they're authorized to access.
You can access the database using the client-side JavaScript SDK directly, or you can use the AngularFire library, which wraps the JavaScript SDK and makes it easier to integrate Firebase into your Angular app.
If you're new to this, I highly recommend reading the documentation I linked above, or taking of the many excellent tutorials on AngularFire.
Upvotes: 2