Closed notrespire closed 2 years ago
Hi, something like this?
if(debug) {
// Define a single route that matches all requests
Route::add('/(.*)', function() {
echo 'Debug mode<br>';
});
} else {
// Define all not maintenance routes
Route::add('/', function() {
echo 'Welcome :-)';
});
}
You know what... For some reason, I had it in my head that regular PHP statements wouldn't work... Not sure why. Brain fart.
This worked perfectly. Thank you
Would it be possible to create a maintenance mode route that would over write all other routes while enabled?
Including the new route in Index.php would supersede all other routes and return whatever you want. Commenting it out, or removing would restore function of the existing routes.
Thanks for this project! Super simple to use and learn from, especially for newer developers like myself.