# Routing middleware really doesn't want to work \[Solved\]

**URL:** <https://discourse.slimframework.com/t/routing-middleware-really-doesnt-want-to-work-solved/6052>\
**Category:** Questions\
**Created:** [February 18, 2025, 12:23am UTC](https://discourse.slimframework.com/t/routing-middleware-really-doesnt-want-to-work-solved/6052 "2025-02-18T00:23:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremk](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@Jeremk](https://discourse.slimframework.com/u/Jeremk)\
**Post date:** [February 18, 2025, 12:23am UTC](https://discourse.slimframework.com/t/routing-middleware-really-doesnt-want-to-work-solved/6052/1 "2025-02-18T00:23:14Z")

</div>

slim/slim: ^4.14  
slim/psr7: ^1.7

I do things like this :

```
 $app->group(BASE_URI . "/art", function($app) use($connexionBD): void 
{
  
    $repositoryArtefacts = new RepositoryArtefact($connexionBD);
    $controllerArtefact = new ControllerArtefact($repositoryArtefacts);

    $app->get('', [$controllerArt, 'getCollection']);
    $app->get('/{id:\d+}', [$controllerArt, 'getSingle']);
})->add(function (PsrRequest $request, RequestHandlerInterface $handler): PsrResponse {

    
    $response = $handler->handle($request);
    return $response;
});

```

I found the fix it was in another route
