Skip to content

Commit

Permalink
add users routes
Browse files Browse the repository at this point in the history
  • Loading branch information
srgoogle23 committed Dec 28, 2024
1 parent e72e3d4 commit e381d14
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@
* @contact [email protected]
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
use App\Controller\UserController;
use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');

Router::addGroup('/users', function () {
Router::get('', [UserController::class, 'index']);
Router::get('/{id}', [UserController::class, 'show']);
Router::post('', [UserController::class, 'store']);
Router::delete('/{id}', [UserController::class, 'delete']);
});

Router::get('/favicon.ico', function () {
return '';
});

0 comments on commit e381d14

Please sign in to comment.