Brief description of the structure:
index.ejs:显示数据
list.ejs:后台获取到的数据列表模板
admin.js:数据渲染文件,用来获取后台数据的
The connection between the three is to get all the articles in the database through admin.js, pass them to list.ejs through locals.list, and then render list.ejs to the index.ejs part.
index.ejs
The following is a list of background data obtained through include introduction
Find ejs online 2.0 You can pass parameters through <%- inclund("article/list",{list:locals.list}), but no parameters are received in list.ejs. The console still reports an error
list.ejs
admin.js
The following is the error message
Everyone who has passed by can give me your opinion