?<?php
require_once '../src/TimeTravelCache.php';
$cache = new TimeTravelCache();
$key = $_GET['key'] ?? '';
$index = isset($_GET['index']) ? (int)$_GET['index'] : -1;
header('Content-Type: application/json');
echo json_encode(['value' => $cache->getByIndex($key, $index)]);
|