I've recently built a small API using the Slim PHP framework and it is working great. I would however like to set a GET route for the root "/" which responds with a basic message and have any other GET requests return an "access denied".
Upon reading both the documentation and various examples, I have not been able to figure out how to accomplish either of these tasks. My project only relies on POST routes but being able to respond to GET requests aimed at both the root domain and any other pages would be fantastic.
Code:
// SLIM INSTANCE
$app = new \Slim\Slim();
$app->contentType('application/json');
// SLIM ROUTES
$app->group('/core', function() use ($app)
{
$app->post( '/create', 'Create' );
$app->post( '/start', 'Start' );
$app->post( '/stop', 'Stop' );
$app->post( '/delete', 'Delete' );
});