akashyap2013 / CRUD_Application_Node

In this project, we are going to create node CRUD application with express and mongodb.
Apache License 2.0
269 stars 270 forks source link

Updated files render.js and index.js #16

Open m-naeem66622 opened 1 year ago

m-naeem66622 commented 1 year ago

Fixed error connect ECONNREFUSED ::1:3000

Fixed port error and routes /, /update-user because of render.js and index.js error: "message":"connect ECONNREFUSED ::1:3000","name":"Error","stack":"Error: connect ECONNREFUSED ::1:3000\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)","config":{"url":"http://localhost:3000/api/users","method":"get","headers":{"Accept":"application/json, text/plain, */*","User-Agent":"axios/0.21.0"},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1},"code":"ECONNREFUSED"

render.js and index.js had PORT=3000 hard cored in a code. The PORT entered in config.env rather than 3000 show above error. Because only file server.js getting PORT from config.env.