I'm trying to set an optional parameter on the index route but can't seem to get it working. I would like to have the option to be able to pass a parameter or not. I can't seem to get anything to work. I was expecting something like the following:
$app->get('/(:token)', function ($req, $res){
// Do Something
});
I came across this solution which is exactly what I want to achieve but can't seem to get it working. Any help would be greatly appreciated!