When I try to add new item in my Todolist App i get an error: dial tcp 127.0.0.1:10000: connect: connection refused

As i have mentioned, when I try to add a new item in my webiste I get a connection refused error. But when i reload my page i am able to see the items added and deleted when checked and meanwhile my MongoDB database is updated immediately.
Can someone help me with the issue of not reloading page and redirecting to other page automatically or should i have to refresh my UI component forcibly? if yes, how to achieve it?
My GitHub code for reference:GitHub - Varshaj666/TodoList_WebApp: User can create his todolist by adding items in today list and also he can create items in his customized list name by redirecting it.

Thanks in Advance

Hi,

I would think your logs may have something to shed some more light on the issue.

Alan

any solution to this problem yet?

Apr 4 08:56:26 PM ==> Cloning from GitHub - Varshaj666/TodoList_WebApp: User can create his todolist by adding items in today list and also he can create items in his customized list name by redirecting it.
Apr 4 08:56:27 PM ==> Checking out commit 48dc6725d5c2e988d4f9468a4e74f12713f83ded in branch master
Apr 4 08:56:29 PM ==> Downloading cache…
Apr 4 08:56:40 PM ==> Transferred 47MB in 7s. Extraction took 2s.
Apr 4 08:56:42 PM ==> Detected Node version 18.12.0
Apr 4 08:56:42 PM ==> Running build command ‘npm install’…
Apr 4 08:56:44 PM
Apr 4 08:56:44 PM up to date, audited 163 packages in 1s
Apr 4 08:56:44 PM
Apr 4 08:56:44 PM 5 packages are looking for funding
Apr 4 08:56:44 PM run npm fund for details
Apr 4 08:56:44 PM
Apr 4 08:56:44 PM 4 vulnerabilities (3 high, 1 critical)
Apr 4 08:56:44 PM
Apr 4 08:56:44 PM To address issues that do not require attention, run:
Apr 4 08:56:44 PM npm audit fix
Apr 4 08:56:44 PM
Apr 4 08:56:44 PM To address all issues (including breaking changes), run:
Apr 4 08:56:44 PM npm audit fix --force
Apr 4 08:56:44 PM
Apr 4 08:56:44 PM Run npm audit for details.
Apr 4 08:56:44 PM ==> Generating container image from build. This may take a few minutes…
Apr 4 08:57:50 PM ==> Uploading build…
Apr 4 08:57:50 PM ==> Uploading build…
Apr 4 08:58:15 PM ==> Build uploaded in 16s
Apr 4 08:58:15 PM ==> Build successful :tada:
Apr 4 08:58:15 PM ==> Deploying…
Apr 4 08:57:50 PM ==> Uploading build…
Apr 4 08:58:15 PM ==> Build uploaded in 16s
Apr 4 08:58:15 PM ==> Build successful :tada:
Apr 4 08:58:15 PM ==> Deploying…
Apr 4 08:58:59 PM ==> Detected Node version 18.12.0
Apr 4 08:58:59 PM ==> Starting service with ‘node app.js’
Apr 4 08:59:04 PM (node:53) [MONGOOSE] DeprecationWarning: Mongoose: the strictQuery option will be switched back to false by default in Mongoose 7. Use mongoose.set('strictQuery', false); if you want to prepare for this change. Or use mongoose.set('strictQuery', true); to suppress this warning.
Apr 4 08:59:04 PM (Use node --trace-deprecation ... to show where the warning was created)
Apr 4 08:59:04 PM Server has started on port10000
Apr 4 08:59:05 PM connected to database todolistDb server

As you can see my logs the server has started successfull and still i get lot of issues in redirecting to other page by user inputs and also above error message mentioned.
Hope i look forward to reply you might find any issue and give me a solution!

I found out the solution by checking my logs.
The mongoose.connect() the URL should be written in ’ ’ quotes and add {writeConcern: { w: ‘majority’, j: true, wtimeout: 1000 }

Check the documentation for more details:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.