This is a simple test script for create a new route:
add_action( 'rest_api_init', function () {
register_rest_route( 'ass', '/ativar', array(
'methods' => 'GET',
'callback' => 'testing_route',
) );
} );
function testing_route($data){
return array( 'message' => 'testing route' );
}
But it returning an error message:
rest_invalid_handler