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

14 lines
292 B
PHP

<?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();