I am working with ExpressJS route and everything works not until I added a route in which I get the error message,
Cannot GET /api/users/abc
using Postman.
Below are images that describe the challenge right now.
From my server.js file
To my userRoutes.js file
Every route works fine but /user_stats route doesn't. My approach to debugging the problem is to create an /abc route but to no avail, I got this HTTP response from Postman
Now the question, what might have gone wrong in my code?
It seems after adding the route you haven't started the server. So, to make sure every time you made any changes to the files get reflected in the server build, you should install nodemon and make it run.
npm install --save-dev nodemon // only for dev
To run :
nodemon [your node app]
For more details check this, how you can configure your server to run the build files.