I am trying to build an express.js app and I want to pass some data to my main layout. For example, a list of navigation links that I use on every page. I know how to pass data
Here you can include file of header & footer inside your each ejs file
ejs
<%- include('/header.ejs') %> <%- include('/footer.ejs') %>
This is for ejs view engine
app.set("view engine", "ejs");