I have been stuck on an issue for quite some time and cannot seem to figure out what I am doing wrong. When I cd into my project's src folder and run node server.js everything works as expected. I am able to open the application on localhost with http://localhost:3000/client/pantry/index.html. However, when trying to make a start script in package.json I encounter some issues. My script does indeed connect to the server as I get a message in console "Server listening on port 3000" from this bit of code: app.listen(port, () => { console.log(Server listening on port ${port}); }); , but when I go to http://localhost:3000/client/pantry/index.html I receive a 404 (Not found) response and page does not load.
Here is a list of things that I have already tried:
"start": "node src/server.js"
}`
this also includes almost every combination of folder structure I can think of (i.e: "start": "node ./src/server.js", "start": "node ../src/server.js", "start": "node ./../server.js", "start": "node server.js", relative path, full path, etc.)
What I think the issue could possibly be:
app.use("/client", express.static("client"));, within my server.js file that allows access to client folder on web. (once again, works fine with node server.js without start script).


without start script vvv

full packag.json Any help is greatly appreciated!
I found the solution to my problem. It was indeed the middleware used to serve the client file on the web. I had to change app.use("/client", express.static("client")); to app.use("/client", express.static("./src/client"));. Now npm start works and node src/server.js works.