In my app there are some static files I would like to serve to the client, but the server does not respond.
app.use(express.static(__dirname, '/public')); This is the relevant piece of code I can't fix alone.
looks like the use of app.use and express.static are being messed up. The code you have will serve the whole of the current directory under / via express, which i doubt is what you want.
the following will make everything within /public available under /public :
app.use('/public', express.static(__dirname + '/public'));
i.e. if you have /public/banner.gif you'll be able to access it through:
http://localhost:{port}/pubic/banner.gif
or you could use the following to and omit the /public from the http request:
app.use(express.static(__dirname + '/public'));
i.e. if you have /public/banner.gif you'll be able to access it through:
http://localhost:{port}/banner.gif