I can connect node.js and mongoDb with my cloud URL but i can't with my localhost url
I install mongoDb ( it's connect on localhost:27017 )
I create :
- database name LMS-v1
- collection name LMS-V1
And when i launch npm run dev i got an error
[INFO] 14:00:57 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.1, typescript ver. 5.2.2)
Server is connected with port 8050
connect ECONNREFUSED ::1:27017
You can check my code on github
1 Answer 1
I find the problem
I have to change
'mongodb://127.0.0.1:27017/Lms-v1'
into
mongodb://127.0.0.1:27017
Sign up to request clarification or add additional context in comments.
Comments
lang-js
.envon your githup repo. Ignore it with.gitignoreconfiguration file