forked from msfidelis/slim-microservices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
routes.php
29 lines (25 loc) · 848 Bytes
/
routes.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/**
* Grupo dos enpoints iniciados por v1
*/
$app->group('/v1', function() {
/**
* Dentro de v1, o recurso /book
*/
$this->group('/book', function() {
$this->get('', '\App\v1\Controllers\BookController:listBook');
$this->post('', '\App\v1\Controllers\BookController:createBook');
/**
* Validando se tem um integer no final da URL
*/
$this->get('/{id:[0-9]+}', '\App\v1\Controllers\BookController:viewBook');
$this->put('/{id:[0-9]+}', '\App\v1\Controllers\BookController:updateBook');
$this->delete('/{id:[0-9]+}', '\App\v1\Controllers\BookController:deleteBook');
});
/**
* Dentro de v1, o recurso /auth
*/
$this->group('/auth', function() {
$this->get('', \App\v1\Controllers\AuthController::class);
});
});