Within the views directory, there is a public directory that contains the css, js, and image directories. While the css and js files in the public directory are functioning properly, only one image (specifically the logo in the navbar section) loads on the browser when the server is started up. The other images display as small icons in their designated positions. All images are stored in the same directory and linked in the same manner, so it's puzzling why only one appears on the browser. I'm unsure if placing the public directory inside the views directory is best practice. When I placed them both at the same level with app.js, all the files in the public directory stopped working. This situation highlights some anomalies:
The inclusion of app.use(express.static("public")); in app.js doesn't make a difference to the functionality of the css and js files, suggesting this line of code isn't effective despite the files still working.
Even though all images are linked similarly, only one displays on the browser.
The term "public" is present in the source of each static file; removing it results in none of the static files working correctly.
App structure: med, webapp, main, views, partials footer.ejs header.ejs public bootstrap css js images home.ejs post.ejs news.ejs about.ejs contact.ejs app.js package.json
Indentation may help convey the structure since image uploads are not possible at present. The images in home.ejs are: img src="../views/public/images/syringe-pill-capsule.jpg" img src="../views/public/images/dna-1811955_1920.jpg" img src="../views/public/images/lab-217043_1280.jpg" Among these, only the logo in the navbar, located in header.ejs, successfully loads with the link img src="../public/images/wd.jpg"