test-php-rest-api-user/engine/core/api.php

14 lines
292 B
PHP
Raw Normal View History

2024-08-10 00:30:13 +08:00
<?php
header('Content-Type: application/json');
if(file_exists(__CD__.'api/'.__URL__[1].'/'.__URL__[2].'.php'))
require __CD__.'api/'.__URL__[1].'/'.__URL__[2].'.php';
else
$data = [
'error' => true,
'message' => 'Endpoint not exists.',
];
echo json_encode($data);
exit();