Skip to content

Commit

Permalink
Merge pull request #30 from ngekost-aja/develop
Browse files Browse the repository at this point in the history
add routing for api
  • Loading branch information
FarrelAD authored Nov 10, 2024
2 parents 9279b12 + edd12bc commit cf513b3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/controllers/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

class Users extends Controller {

public function __construct() {

}

public function index(): void {

echo "Hello!";
}
}
3 changes: 3 additions & 0 deletions backend/public/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

require_once __DIR__ . '/../routes/api.php';
11 changes: 11 additions & 0 deletions backend/routes/api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

require_once __DIR__ . '/core/Router.php';
require_once __DIR__ .'/controllers/Users.php';

use App\Core\Router;
use App\Controllers\Users;

Router::add('GET', '/', Users::class, 'index');

Router::run();

0 comments on commit cf513b3

Please sign in to comment.