System Information
- Strapi Version:
- Operating System:
- Database:
- Node Version:
- NPM Version:
- Yarn Version:
I have recently deployed my strapi cms to heroku. and I have configured the project as mentioned in the doc of strapi deployment with heroku. After the deployment i can’t connect to my mongodb atlas in developmnet mode.
When i run ‘yarn run develop
’ it gives me this error
yarn run v1.22.10
$ strapi develop
[2021-05-30T08:17:05.171Z] info File created: F:\freetoos_remastered\freetoos-backend\config\env\develop\database.js
[2021-05-30T08:17:05.174Z] info The server is restarting
[2021-05-30T08:17:38.047Z] debug ⛔️ Server wasn't able to start properly.
[2021-05-30T08:17:38.048Z] error Error connecting to the Mongo database. getaddrinfo ENOTFOUND undefined
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
here’s my prject structures.
./config
--------development
-------------database.js
---------production
--------------database.js
–server.js
–database.js
./config/database.js
looks this.
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'mongoose',
settings: {
uri: env('DATABASE_URI'),
},
options: {
ssl: true,
},
},
},
});