How to Reemplace findOne for ID for slug in strapi 4.0

I meant to search by slug instead of id, the ids are by order of arrival so it doesn’t help me when searching for them.

I found one way which is to create a controller and a route, but I don’t know if there is a more efficient way to do it.

Example: /api/productos/:slug