System Information
- 3.4.4:
- Windows 10:
- SqLite:
- 10.16.0:
- NPM Version:
- Yarn Version:
Hi There
I’m a newbie to Strapi - trying to extend the API by making my own route and controller method:
routes.json:
{
"method": "GET",
"path": "/observations/gallery",
"handler": "observation.gallery",
"config": {
"policies": []
}
}
and my own controller method:
observation.js
module.exports = {
async gallery(ctx) {
let entities;
entities = await strapi.query('observation').find();
return entities.map(entity => sanitizeEntity(entity, { model: strapi.models.observation }));
}
};
The controller method is visible and enabled in admin/settings/users-permissions/roles/
But I keep getting 404 when trying to call it by localhost:1337/observations/gallery.
Thanks in advance for any hints…
/Thomas