Displaying static files in Express
If you want the webapp in the last tutorial to display a static image, it would give a 404 error. To fix this, use the express.static middleware like this …
That means that anything placed inside the “public” folder will be display straight through by Express without processing. Note that there is no “public” in the URL.
You can learn more here.