Develop Custom Router Implementation

The HTTP router is designed to be interopable, meaning you can quite easily switch it out for your own implementation if desired. To change the HTTP router, open the /boot/continaer.php file and look for a line that starts with:


Change the value of that line to any PHP class you would like, and all further HTTP requests will flow through it. The only requirement is that it must implment the RouterInterface class which can be downloaded at:

It's simply one class that contains a lookup() method which takes in a ServerRequestInterfface object, and returns a RouterResponse object, the interface of which can be viewed at: