score:1

Accepted answer

assuming your server.js file and your public directory exist at the same level, the path.resolve(__dirname, 'public') will build the full path to the public directory where all of your static resources should exist. when you reference these files inside your html pages you specify the path relative to the public directory.

<link href="css/main.css"/>

this should be enough to find the file. assuming that file exists at ../public/css/main.css.


Related Query

More Query from same tag