为自托管解析服务器使用节点解析API

Using Node Parse API for self-hosted Parse Server

本文关键字:节点 点解 API 服务器      更新时间:2023-09-26

我在Parse平台上构建了一个Parse服务器。在我以前的Parse应用程序中,我使用这个用于NodeJS 的REST API库

我应该如何配置(在Parse初始化或Parse库模块中)向这个新构建的Parse服务器发送REST请求。例如,我的解析服务器的配置包含:

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

节点模块将serverUrl指定为api.parse.com,原始装载路径为'1'。https://github.com/Leveton/node-parse-api/blob/master/lib/Parse.js

试试这两个步骤。1.设置Parse_api_host到您的主机。2.将mountPath更改为"1"。

另一个Parse-Rest API util是kaiseki,有一个pr适合开源解析,但尚未合并。https://github.com/shiki/kaiseki/pull/35

您可以使用请求模块并执行以下操作:

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
                }
            });

希望这能帮助