【发布时间】:2018-11-26 16:58:00
【问题描述】:
我已经启动 Node 服务器和 Mongod 并尝试运行示例程序。
命令提示符的输出:
mongod 命令提示符:
2018-06-17T23:38:19.464+0530 I FTDC [initandlisten] Initializing full-time diagnostic
data capture with directory 'C:/data/db/diagnostic.data'
2018-06-17T23:38:19.466+0530 I NETWORK [initandlisten] waiting for
connections on port 27017
mongo 命令提示符:
MongoDB shell 版本 v3.6.5
connecting to: mongodb://127.0.0.1:27017
我可以通过从命令提示符启动 mongo 在 mongo shell 中运行命令。 但是示例程序抛出异常。
http://localhost:3000/api/graphql
[0] [HPM] Error occurred while trying to proxy request /api/graphql from
localhost:3000 to http://localhost:4040 (ECONNREFUSED)
(https://nodejs.org/api/errors.html#errors_common_system_errors)
我不确定 4040 端口上没有其他进程正在运行。
让我知道如何解决此问题。
更新步骤顺序:
install npm
install mongodb
$ git clone https://github.com/linnovate/mean.git
$ cd mean
$ npm install && npm start
npm start will open default home page : http://localhost:3000/
On home page, click on GraphQL browser
【问题讨论】:
-
您只发布了错误...请发布一些代码...您尝试在浏览器上粘贴
localhost:4040/graphql吗?它将显示连接是否建立 -
这是来自 Node.js 的示例代码。默认主页(localhost:3000)浏览器中有一个链接GraphQL,它调用localhost:3000/api/graphql
-
这个问题你解决了吗?