简体   繁体   English

如何使用 Firebase 创建 nodeJS API

[英]How to create nodeJS API with Firebase

I'm new to firebase part and I've one requirement to use firebase as a part of serverless architecture, below mentioned is something I need to do, can expertly guide me what to choose from firebase to achieve the same.我是 firebase 部分的新手,我有一个要求将 firebase 用作无服务器架构的一部分,下面提到的是我需要做的事情,可以专业地指导我从 firebase 中选择什么来实现相同的目标。

  1. I want to create restful API using firebase with NodeJs with an express module of the node, is it something possible or any alternative way to achieve the same using nodejs?我想使用带有 NodeJs 的 firebase 和节点的 express 模块来创建宁静的 API,是否有可能或任何其他方式使用 nodejs 实现相同的目标?

  2. I want to use the firebase authentication mechanism with nodejs code part, ultimately want to create API using the nodeJS with firebase to authenticate the user, so what to use from firebase to achieve the same?我想使用带有 nodejs 代码部分的 firebase 身份验证机制,最终想使用带有 firebase 的 nodeJS 创建 API 来验证用户,那么使用 firebase 来实现相同的功能?

  3. There would be straight forward API that I want to create including the authentication and data store in cloud using firebase, here do I need to use either firestore or real-time database?我想创建直接的 API,包括使用 firebase 在云中的身份验证和数据存储,这里我需要使用 firestore 还是实时数据库?

I want to deploy the nodeJs project using firebase with firebase cloud, can give me some more details on like how we can do that, reference link sharing would be appreciated.我想使用 firebase 和 firebase cloud 部署 nodeJs 项目,可以给我一些更多的细节,比如我们如何做到这一点,参考链接共享将不胜感激。

I had a basic look into few stuff like firebase client SDK, firebase admin SDK, not sure in my case whether I would require to use client SDK or admin SDK to create restFul API.我对诸如 firebase 客户端 SDK、firebase 管理 SDK 之类的东西有一个基本的了解,但不确定我是否需要使用客户端 SDK 或管理 SDK 来创建 restFul API。

Note: I want to use no SQL data base, where various collection I can create and can use the same using firebase, I checked that and firestore would perform the same thing, like to store the JSON data, but wanted to know is there any other way to store data or firestore is the best option?注意:我不想使用 SQL 数据库,我可以在其中创建各种集合,并且可以使用 Firebase 使用相同的集合,我检查了一下,firestore 会执行相同的操作,比如存储 JSON 数据,但想知道有没有其他存储数据的方式或 firestore 是最佳选择吗?

I checked somewhere on reference link about the cloud function, this function can be triggered based on some event, including some https request trigger as well, wanted to confirm using cloud function to create restful API is the good approach or what is the best way to create API using firebase.我在参考链接上查看了有关云功能的某个地方,该功能可以基于某些事件触发,包括一些 https 请求触发器,想确认使用云功能创建restful API 是好方法还是最好的方法使用 Firebase 创建 API。

I want to create restful API using firebase with NodeJs with express module of node, is it something possible or any alternative way to achieve the same using nodejs?我想使用带有 node 的 express 模块的 nodejs 的 firebase 创建 restful API,是否有可能或任何其他方法使用 nodejs 实现相同的目标?

Yes it is possible对的,这是可能的

I want to use the firebase authentication mechanism with nodejs code part, ultimately want to create API using the nodeJS with firebase to authenticate the user, so what to use from firebase to achieve the same?我想使用带有 nodejs 代码部分的 firebase 身份验证机制,最终想使用带有 firebase 的 nodeJS 创建 API 来验证用户,那么使用 firebase 来实现相同的功能?

You can use firebase SDK for authentication您可以使用 firebase SDK 进行身份验证

There would be straight forward API that I want to create including the authentication and data store in cloud using firebase , here do I need to use either firestore or real time data base?我想创建直接的 API,包括使用 firebase 在云中进行身份验证和数据存储,这里我需要使用 firestore 还是实时数据库?

If you are asking of the database, then you can use any database of your choice, wheater it is MongoDB, firebase-realtime-database etc如果您询问数据库,那么您可以使用您选择的任何数据库,但它是 MongoDB、firebase-realtime-database 等

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM