【发布时间】:2019-02-18 02:24:59
【问题描述】:
对于部署在 gcp 应用引擎上的应用程序,我无法连接到我的 mlab mongodb。该应用程序在部署到 heroku 和 localhost 时工作正常。我检查了类似的线程,例如 Connecting Mongoose on Google App Engine,但仍然找不到解决方法。
(node:531) UnhandledPromiseRejectionWarning: Unhandled promise rejection
(rejection id: 1): MongoNetworkError: failed to connect to
server[ds111422.mlab.com:11422] on firstconnect [MongoNetworkError:
connection 0 to ds111422.mlab.com:11422 timed out] (node:531) [DEP0018]
DeprecationWarning: Unhandled promise rejections are deprecated. In the
future, promise rejections that are not handled will terminate the Node.js
process with a non-zero exit code.
我检查了谷歌的文档,可以找到任何用于猫鼬连接的,只有一个用于使用普通 nodejs 的直接连接。 提前致谢
【问题讨论】:
标签: node.js mongodb google-app-engine mongoose google-cloud-platform