Skip to main content

Posts

Showing posts with the label PHP routing library for fast API development

PHP routing library for in laravel8 fast API development 2021

What it is? | Laravelnote PHP Routing is a custom written routing library that was inspired by the  Slim framework . It was written as a small and lightweight alternative to it as I needed to use something with as little overhead as possible . The first version of the library was consisting of a single PHP class that was able to handle static and some basic dynamic routes and had a semi working support for adding and using middlewares. At first that was more than enough for my use case and the library was left at that, but recently I started rewriting one of my personal projects  Did You Buy It?  live on my  Twitch  channel and decided I wanted to use PHP for it, as the original API was developed using Node and Express. What does it do? | Laravelnote Exaxmple on how to add your own routes: $routes = new Routes ; $routes -> add ( '/' , function () { echo "Hello world" ; }, Routes :: GET ); // If the request method is not specified the GET method is used