Why my Controller Error?

Hello im new in slim,

i have some problem while creating a controller, here’s my code

my directory

config
– routes.php
public
src
– Action
— AppAction.php

routes.php

<?php
use App\Action\AppAction;

// Routes Here
$app->get('/', AppAction::class . ':index');

AppAction.php

<?php

namespace App\Action\AppAction;

class AppAction {

public function index(){

    $response->getBody()->write("Hello world");
    return $response;
    }
}

composer.json

"autoload": {
    "psr-4": {
        "App\\": "src/"
    }
}

I Got This error

Uncaught RuntimeException: Callable App\Action\AppAction does not exist

all this code gives me a headache, I will be very grateful to anyone who helps me, thank you

Try to dump the autoloader:
composer dump-autoload

its return

Generated autoload files containing 0 classes

Have you installed the dependencies ?
How have you installed slim ?

At a glance it looks like the namespace declaration in AppAction.php ought to be App\Action rather than App\Action\AppAction. In the latter case you would reference the AppAction class as App\Action\AppAction\AppAction::class.