To serve images, CSS stylesheets, client-side JavaScript, and PDFs, use the built-in express.static() middleware. Pass the name of the directory containing your static assets (commonly public).
You can also mount a virtual path prefix so files in public/logo.png are served at /assets/logo.png.
ADVERTISEMENT