<?php
declare(strict_types=1);

require_once __DIR__ . '/slot_games_lib.php';

header('Content-Type: application/json; charset=utf-8');
header('Cache-Control: public, max-age=3600');
header('X-Content-Type-Options: nosniff');

if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'GET') {
    http_response_code(405);
    echo json_encode(['ok' => false, 'error' => 'method'], JSON_UNESCAPED_UNICODE);
    exit;
}

$list = mocker_slot_list_providers();

echo json_encode([
    'ok' => true,
    'providers' => $list,
], JSON_UNESCAPED_UNICODE);
