【问题标题】:connecting nextjs app to mongodb in digitalocean将 nextjs 应用程序连接到 digitalocean 中的 mongodb
【发布时间】:2022-12-17 07:20:29
【问题描述】:

我正在尝试将 nextjs 应用程序连接到 digitalocean 中的 mongodb 我尝试将托管在我本地机器上的 nextjs 应用程序连接到 digitalocean 中的 mongodb,它工作正常, 但是什么时候部署我的应用程序我得到连接超时错误。 这是我所做的:

  1. 我在 digitalocean 中创建了 mongodb
  2. 我在本地导出 ws 并执行我的 nextjs 应用程序并连接到 digitalocean 中的 mongodb,它工作正常
  3. 我将我的代码推送到 github repo
  4. 我从那个 repo 在 digitalocean 中创建了新的应用程序
  5. 我将我的 mongodb mongodb 附加到应用程序并将 trush 连接添加到我在 mongodb mongodb 中的应用程序
  6. 我在变量 env 中添加 url 连接 7.我尝试部署我的应用程序,但我仍然收到连接超时错误

    我不知道怎么了

【问题讨论】:

    标签: node.js mongodb next.js digital-ocean


    【解决方案1】:

    你能检查一下你的 IP 地址是否被列入访问 DigitalOcean 的白名单吗?

    【讨论】:

      猜你喜欢
      • 2022-08-05
      • 2020-05-08
      • 2019-01-05
      • 1970-01-01
      • 1970-01-01
      • 2017-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多