I tried the official documentation, but this does not work.
https://github.com/strapi/strapi-docs/blob/master/files/views.md
Here is a guide on How to use EJS with Strapi
...
{
"ejs": {
"enabled": true,
"layout": false,
"viewExt": "ejs",
"partial": true,
"cache": false,
"debug": true
}
}
...
module.exports = {
//GET /index
index: async (ctx) => {
ctx.render('home', {title: 'Hello world'});
}
};
<%= title %>
Side note: In the above example, I have used the "index" in the controller api-name.js file. Make sure your API ./api/api-name/config/routes.json point to it.