I have a bunch of routes and they all start with /api/2.01
.
How can I add it once so it applies to all routes. Slim Framework Base URL asks the same question, but I believe provides an outdated answer.
PS. If instead of asking a new question, should I have instead somehow tagged the post which I believe is dated to be reviewed or something?
$app = new \Slim\Slim();
$app->post('/api/2.01/books', function () {
//Create books
});
$app->get('/api/2.01/books', function () {
//getbook
});
$app->get('/api/2.01/books/{id}', function () {
//Get book
});
$app->delete('/api/2.01/books/{id}', function () {
//Create book
});