Closed RWDevelopment closed 1 year ago
@RWDevelopment By default, there is not such a method. But you can use something like this:
$app->all('.*', function($req, $res) { $res->status(404)->send('Page not found'); });
or
$app->all('.*', function($req, $res) { $res->render('path/to/errors/404')); $res->status(404); });
Note: insert the code right before $app->run();
thanks, it works fine
has php-express default error (notFound) method to show 404 error page ? any hints to write this ? how to do it ?