If you need to display static content like images, CSS, and JavaScript files on your website, you can utilize the express.static middleware function provided by Express.
Here's an example of how you can use this function to serve files from a directory named public:
app.use(express.static('public'))
After implementing the above code, you can access the files stored in the public directory through URLs like:
http://localhost:3000/images/kitten.jpg
http://localhost:3000/css/style.css
http://localhost:3000/js/app.js
http://localhost:3000/images/bg.png
http://localhost:3000/hello.html
Express will automatically fetch the files from the specified directory without the need to include the directory name in the URL.