Facing error "Failed to load resource: the server responded with a status of 404 (Not Found)" in web browse console

It seems like the problem is the JS files not being in the public folder. Express limits available files to a specified folder, so that no one can access your server.js through the browser and potentially exploit vulnerabilities in your code. Put your p5.* files into the public folder and it should work.