Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 无法连接到';http://localhost/parse' 无法发布/解析/类/游戏分数_Node.js_Mongodb_Parse Platform - Fatal编程技术网

Node.js 无法连接到';http://localhost/parse' 无法发布/解析/类/游戏分数

Node.js 无法连接到';http://localhost/parse' 无法发布/解析/类/游戏分数,node.js,mongodb,parse-platform,Node.js,Mongodb,Parse Platform,我有Ubuntu 16.o4。使用教程I setup node.js,解析服务器和mongodb。这是我的index.js 我安装了node.js 9.x和mongodb 3.6 var api = new ParseServer({ databaseURI: databaseUri || 'mongodb://localhost:27017/myapp', cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js

我有Ubuntu 16.o4。使用教程I setup node.js,解析服务器和mongodb。这是我的index.js

我安装了node.js 9.x和mongodb 3.6

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/myapp',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAPP',
  masterKey: process.env.MASTER_KEY || 'myMASTER', //Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',  // Don't forget to change to https if needed
  liveQuery: {
    classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
  }
});
当我试图

npm start
我得到一条信息:

> parse-server-example@1.4.0 start /root/parse-server-example
> node index.js

DATABASE_URI not specified, falling back to localhost.
parse-server-example running on port 1337.

WARNING, Unable to connect to 'http://localhost:1337/parse'. Cloud code and push notifications may be unavailable!
然后安装仪表板:

sudo npm install -g parse-dashboard
在dashboard中,我创建了带有行的自定义类,所有内容都保存得很好

但当我尝试使用curl添加一些数据时:

curl -X POST \
  -H "X-Parse-Application-Id: myAPP" \
  -H "Content-Type: application/json" \
  -d '{"score":1337,"playerName":"Sammy","cheatMode":false}' \
  http://myIP:1337/parse/classes/GameScore  // or http://localhost:1337/parse/classes/GameScore
我有一个错误:

Cannot POST /parse/classes/GameScore
如果有人帮我,我会很感激的