Created
September 5, 2020 15:31
-
-
Save karthiks/70ddc49a332e27bcc8fd4beed55e3932 to your computer and use it in GitHub Desktop.
The Workaround Configuration to connect to MongoDB Atlas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = ({ env }) => ({ | |
defaultConnection: 'default', | |
connections: { | |
default: { | |
connector: 'mongoose', | |
settings: { | |
host: env('DATABASE_HOST', 'cluster0-shard-00-00.hp5fc.mongodb.net:27017,cluster0-shard-00-01.hp5fc.mongodb.net:27017,cluster0-shard-00-02.hp5fc.mongodb.net:27017'), | |
srv: env.bool('DATABASE_SRV', false), | |
port: env.int('DATABASE_PORT', 27017), | |
database: env('DATABASE_NAME', 'cmsdb'), | |
username: env('DATABASE_USERNAME', 'YourMongoDBAtlasAdminUser'), | |
password: env('DATABASE_PASSWORD', 'YourMongoDBAtlasAdminPassword'), | |
}, | |
options: { | |
authenticationDatabase: env('AUTHENTICATION_DATABASE', null), | |
ssl: env.bool('DATABASE_SSL', true), | |
}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment