Middleware to change the response of endpoints 'users' and 'users/:id'

System Information
  • Strapi Version: V4

Hello, I’ve started to play with middlewares, it’s great !

Here’s an example of how I can inject a middleware when calling playlists or playlists/:id (I edited the file api/routes/playlist.js).

module.exports = createCoreRouter('api::playlist.playlist', {
 config: {
   find: {
     middlewares: ['api::playlist.playlist.find']
   },
   findOne: {
     middlewares: ['api::playlist.playlist.find-one']
   },
 },
})

But know, I want to add another middleware to update the responses returned by the API when calling /users or /users/:id.

Since there is no directory api/user, how should I register a middleware for this ?

Thanks