0

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

asked Sep 26, 2023 at 12:08
2
  • Have you done some research about your error ? maybe : stackoverflow.com/questions/46523321/… BTW, you shouldn't share your .env on your githup repo. Ignore it with .gitignore configuration file Commented Sep 26, 2023 at 12:13
  • thansk i find the solution in your link !!!!! Commented Sep 26, 2023 at 12:31

1 Answer 1

0

I find the problem I have to change 'mongodb://127.0.0.1:27017/Lms-v1' into mongodb://127.0.0.1:27017

answered Sep 26, 2023 at 12:30
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.