Hello, I’m working on upgrading from Strapi 3 to 4, and I am trying to setup my new route files. v4 code migration - Routes - Strapi Developer Docs
I have setup a routes file, a controller file, and a service file, similar to the example here strapi/examples/getstarted/src/api/address at master · strapi/strapi · GitHub.
The app starts fine when my routes/levels.js file does not exist, but when add it and I run strapi develop
, I get the following error:
Error creating endpoint GET /levels: Cannot read property 'find' of undefined
TypeError: Error creating endpoint GET /levels: Cannot read property 'find' of undefined
Here is my routes/levels.js file:
const { createCoreRouter } = require('@strapi/strapi').factories;
module.exports = createCoreRouter('api::levels.level', {
config: {
find: {
auth: false
}
}
});
Is there anything I could be missing here? I thought having a controller setup might fix this, but I still am seeing this issue.