I also enabled public access as you can see on the screenshot.
But this route always gives me a 404 response !
This topic has been created from a Discord post (1266325235628507157) to give it more visibility.
It will be on Read-Only mode here. Join the conversation on Discord
I tried but it did not work. I must mention that I have other custom routes on GET method that work, and they have been written the same way as I did for this command object.
yes, I am running strapi develop.
I need the find and findOne yes.
hmm well i just setup that same endpoint in my project and had no issues
well yes I have no problem setting up other custom routes, but since today for new GET custom routes, I just can’t get them to work. Do you know where I could dive deeper to find something ?
yup I tried to add this config field, but without success.
What is weird is that when I only allow my “/commands/point” endpoint on public role, I get 403: I need to allow findOne to get 404. It seems that this GET route enters in conflict with the classic findOne route
<@604068445499162664> I have found the solution, which is a weird behaviour:
The routes seem to be loaded for each file located in /routes for a particular object, in an alphabetical order. My order is:
/routes
command.ts
custom-routes.ts
So I guess the core routes are first loaded, and then my custom routes defined in custom-routes.ts. I don’t understand why, but my GET route defined in custom-routes.ts is replaced by the findOne route.
When I change the order of the files to be something like this:
/routes
a-custom-routes.ts
command.ts
Then my custom route is recognized and works. I can’t explain why this is behaving like this, but here it is. So it seems that the general rule would be to always have one’s custom routes file before the core file ones.