简体   繁体   English

构建API时,解析服务器上的业务逻辑go在哪里?

[英]Where does the business logic go on the parse server when building an API?

I am a beginner to the Parse Server, the documentation is great for reading saving and deleting information from a database, but I have yet to see an example that demonstrate where the business logic go on a real API.我是 Parse Server 的初学者,该文档非常适合从数据库中读取保存和删除信息,但我还没有看到一个示例来演示真实 API 上的业务逻辑 go 的位置。

Parse server is a mobile backend as a service (MBaaS) which means it provides the API for you to build the client apps easily without taking the hassle of developing and maintaining backend codes. Parse server 是一种移动后端即服务 (MBaaS),这意味着它提供了API让您轻松构建客户端应用程序,而无需开发和维护后端代码。 You can use parse's rest API or client libraries (android, iOS, JS and so on..) to build an app.您可以使用 parse 的 rest API 或客户端库(android、iOS、JS 等)来构建应用程序。

If you are planning to write your own backend API with parse-server then you can do it just like any other express applications.如果您打算使用 parse-server 编写自己的后端 API,那么您可以像任何其他快速应用程序一样执行此操作。

It seems business logic is supposed to be included in cloud code, on the rest api guide it reads:似乎业务逻辑应该包含在云代码中,在 rest api 指南上显示:

Implementing Business Logic in Cloud Code在云代码中实现业务逻辑

While validation often makes sense in Cloud Code, there are likely certain actions that are particularly sensitive, and should be as carefully guarded as possible.虽然验证通常在 Cloud Code 中有意义,但某些操作可能特别敏感,应尽可能小心保护。 In these cases, you can remove permissions or the logic from clients entirely and instead funnel all such operations to Cloud Code functions.在这些情况下,您可以完全删除客户端的权限或逻辑,而是将所有此类操作集中到 Cloud Code 函数中。

Parse server REST Guide 解析服务器 REST 指南

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

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