Routing weirdness

Hi,

I’m having some weird issues with slim routing. I have this 3 simple routes.

$app->get('/', function (Request $request, Response $response, array $args) {
   die('root');
});

$app->get('/foo', function (Request $request, Response $response, array $args) {
    die('foo');
});

$app->get('/{name}', function (Request $request, Response $response, array $args) {
    var_dump($args);die;
});

If I point may browser to http://localhost:8001 I get root
If I point may browser to http://localhost:8001/foo I get root
If I point may browser to http://localhost:8001/bar I get root

When I hit http://localhost:8001/foo I should be getting foo
and when I hit http://localhost:8001/bar I should be getting the args dump

Is my assumption correct or I’m seeing this incorrectly?

That looks fine at first glance. Which web server are you using and how are you routing requests to the front controller?

I created tree repos to demonstrate the problem:

https://github.com/Narven/using-slim-381
https://github.com/Narven/using-slim-391
https://github.com/Narven/using-slim-skeleton

The readme explains the issues

I added the versions with only base slim… because slim was updated recently. and i wanted to make sure it was not an bug on the new version.

im just running php internal server from local

again… I’m might be doing something extremely stupid. but i don’t see what

the problem Im getting is with the skeleton version… is not routing properly

$ php -S localhost:8003 -t public public/index.php

1 Like

thanks, I knew that was not me and was an issue with paranormal activity :blush: