I am not sure if this can be done. I have done a lot of Googling on this and I don’t get the correct results back.
I am using
Node, Express and EJS for my projects. I have a Schema called Products.
Basically what I want to do is have my
Product Schema available on all of my EJS templates across my whole project. I don’t want to call my model inside each route every time. If I am on the home page I want to be able to access the product data, and if I am on the contact page I also want to access the product data. I was like wondering if I should do some kind of fetch and insert it into my
partials/footer.ejs file, but I don’t know if that is possible.
Is this even possible? Is there a specific module for this? Or am I overthinking this?