How to Count in REST API in v4?

just change your path and handler name…

module.exports = {
    routes: [
        { 
            method: 'GET',
            path: '/academies/count/view',
            handler: 'academy.getCount',
        },
    ]
}