API
Introduction
Basic usage
api.php
$router->get('/users', function () {
API_Handling::Routing('api_management_user', 'index');
});<?php
use MiniMvc\Apps\Core\Bootstraping\API_Handling;
use \Bramus\Router\Router;
// Create a Router object
$router = new Router();
$router->mount('/api', function () use ($router) {
$router->set404(function () {
header('HTTP/1.1 404 Not Found');
redirect_404();
});
// pattern
$router->get('/users', function () {
API_Handling::Routing('api_management_user', 'index');
});
});
// run route!
$router->run();api_management_user.php
Example
api_lokasi_indonesia.php
api.php
Hasil
Last updated