Route from command line

Hi,

Can I call routers from the command line? For example,

$ php ./public/index.php xml
<html>
    <head>
        <title>Method not allowed</title>
        <style>
            body{
                margin:0;
                padding:30px;
                font:12px/1.5 Helvetica,Arial,Verdana,sans-serif;
            }
            h1{
                margin:0;
                font-size:48px;
                font-weight:normal;
                line-height:48px;
            }
        </style>
    </head>
    <body>
        <h1>Method not allowed</h1>
        <p>Method not allowed. Must be one of: <strong>GET</strong></p>
    </body>
</html>

Hi, you can’t do this out of the box, as Slim relies on a proper HTTP Method being used.
Actually not Slim but Fast-Route.

There is a PSR7 Slim-Cli Middleware, which detects a CLI call and Sets the Request method to GET.
While i think it’s debatable to simulate being an HTTP call, rather than a proper implementation of a CLI call, this is what would work right now.