5 ms·
Just curious why you would choose to write your own route handler. I use them (via Laravel) on work projects and I hate them. I hate that I have to look at a r
by Random_Person 8y ago
Just curious why you would choose to write your own route handler.
I use them (via Laravel) on work projects and I hate them. I hate that I have to look at a routes file or controller to find out what is pointed where in my file. I have all my route-handling stuff for each page, at the top of each page so I don't have to go look elsewhere for that info. Is this wrong?
- jstanley 8y agoYou wouldn't write your own route handler, you'd just use a framework. It needn't be complex. I mostly use Mojolicious, where it's as simple as: get '/' => sub { ... }; get '/item' => sub { ... }; etc.
- Random_Person 8y agoInteresting. Thanks!
- tmh88j 8y ago>I use them (via Laravel) on work projects and I hate them. I hate that I have to look at a routes file or controller to find out what is pointed where in my file. Laravel's router is one of the best out there. It makes default parameters a breeze. If you ever get into API development you have no option but to become an expert on routing. >Is this wrong? You should read more documentation and tutorials and try out some other frameworks to see how they handle routing! You'll realize that Laravel's routing is extremely easy to use compared to frameworks. Automatic routing by naming convention like CakePHP and Rails is a recipe for an unmaintainable mess when you're forced to then structure your controllers based on the request type and name them whatever you want your endpoint to be.