rest-api-node | API Rest built with NodeJS , Express and MongoDB | Runtime Evironment library
kandi X-RAY | rest-api-node Summary
kandi X-RAY | rest-api-node Summary
Node API is production ready and open source project in Node, Express and MongoDB.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of rest-api-node
rest-api-node Key Features
rest-api-node Examples and Code Snippets
Community Discussions
Trending Discussions on rest-api-node
QUESTION
I am using mongoDB with and NodeJS backend. The Problem is I am getting the following error
node:16) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [localhost:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 127.0.0.1:27017]
This is my docker-compose
...ANSWER
Answered 2018-Jun-25 at 07:45By default Compose sets up a single network for your app. Each container for a service joins the default network and is both reachable by other containers on that network, and discoverable by them at a hostname identical to the container name.
According to your docker-compose.yaml
file you can access you mongo container on 127.0.0.1:27017
only from host machine.
In order to access it from NodeJS backend container you should use db:27017
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rest-api-node
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page