20 lines
522 B
PHP
20 lines
522 B
PHP
<?PHP
|
|
/**
|
|
* Provides the API.
|
|
*/
|
|
declare(strict_types = 1);
|
|
|
|
require_once __DIR__ . '/../provideEnv.php';
|
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
|
|
$verb = MD_STD_IN::get_http_input_text("verb");
|
|
$subject = MD_STD_IN::get_http_input_text("subject");
|
|
|
|
$output = match ($verb) {
|
|
'evaluate' => (new ConcordanceChecker($subject))->evaluate(explode(PHP_EOL, $_POST['terms'] ?? $_GET['terms'] ?? [])),
|
|
default => throw new MDpageParameterNotFromListException(),
|
|
};
|
|
|
|
echo MD_STD::json_encode($output);
|