Hey, I’m creating a custom controller to be used on a custom route. It should return all the events for current user. But I got a 404. Your help would be appreciated. Thanks.
/src/api/event/routes/me.js
Did you:
1). Allow the authenticated role to use the action ‘me’ in your Event content-type (you are depending on the current authorized user to fulfill the request) in settings.
2). Be sure to add ‘api’ in from of the request, for example: http://localhost:1337/api/events/me (if this url is not correct you will get a 404 error).
I allowed the authenticated role to use “me” in the Event content-type and the request url is “http://localhost:1337/api/events/me”. But I got a 404 error.
I found your problem. Naming a custom route ‘me.js’ is the problem. I created an Event content type like yours and was able to re-create your problem. I would call your route something like ‘custom-event.js’. That worked for me. I hope your database is just for testing because changing the route file broke Strapi for me.
Cheers