简体   繁体   English

将Node Parse API用于自托管的Parse Server

[英]Using Node Parse API for self-hosted Parse Server

I finished building a Parse Server on Parse Platform. 我完成了在Parse平台上构建Parse Server的工作。 In my old Parse App, I utilize this REST API library for NodeJS 在旧的Parse App中,我将这个REST API库用于NodeJS

How should I configure (in Parse initialization or Parse library module) to send REST request to this newly built Parse Server. 我应该如何配置(在Parse初始化或Parse库模块中)将REST请求发送到此新建的Parse Server。 For example, configuration of my Parse Server contains: 例如,我的Parse Server的配置包含:

{
"appId": my_app_id,
"masterKey": my_master_key,
"port": "1337",
"serverURL": my_server_url,
"publicServerURL": my_server_url,
"mountPath": "/parse",
"databaseURI": my_database_uri"
}

The node module is specify the serverUrl to api.parse.com, and origin mount path is '1'. 节点模块将指定的serverUrl指定为api.parse.com,原始安装路径为“ 1”。 https://github.com/Leveton/node-parse-api/blob/master/lib/Parse.js https://github.com/Leveton/node-parse-api/blob/master/lib/Parse.js

Try these 2 step. 试试这两个步骤。 1. set Parse._api_host to your host. 1.将Parse._api_host设置为主机。 2. change your mountPath to '1'. 2.将您的mountPath更改为“ 1”。

Another Parse Rest API util is kaiseki, there is a pr to fit open source parse but not been merged. 另一个Parse Rest API实用程序是kaiseki,有一个pr适合开放源代码解析,但未合并。 https://github.com/shiki/kaiseki/pull/35 https://github.com/shiki/kai​​seki/pull/35

You can use the request module and do something like this: 您可以使用请求模块并执行以下操作:

request({
                url: 'my_server_url',
                //qs: {foo:  bar}, //these are the query string if you want to use them
                method: 'POST', //you get the REST options here
                json: {
                    foo2:   bar1,
                    foo3: bar2
                }
            });

Hope this helps 希望这可以帮助

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

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