node.js - How do i connect nodejs app with mongodb in google cloud platform -


var db = monk('103.196.212.147:27017',  {   username : 'app_staging',   password : 'jimmy@16' }); 

this connection string used

in google cloud getting started, must specify config before running application:

{   "gcloud_project": "[your_project_id]",   "data_backend": "mongodb",   "mongo_url": "mongodb://[your_mongodb_ip_address]:27017/mydb",   "mongo_collection": "books" } 

maybe want take structured data example, in particular config.js, magic done (read environment variables).


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -