css – Pug wont display pictures
Express JS does not allow to serve static files likes images, videos etc. Static files are downloaded by clients from server. However, if
we have to serve static files, we will have to enable middleware
dedicated for this purpose. To do this, first of all we will create a
folder or directory named public in our project directory then add the
following line of code in our index.js.
//use middleware to serve static files app.use(express.static(public));
After that it is possible to just add pictures to the public folder and refer to them in pug with: