'bg-success',
'POST' => 'bg-primary',
'PUT' => 'bg-warning',
'DELETE' => 'bg-danger'
];
$methodClass = $methodMap[strtoupper($api['method'])] ?? 'bg-secondary';
// 获取当前网站URL组件
$scheme = $_SERVER['REQUEST_SCHEME'] ?? 'http';
$host = $_SERVER['HTTP_HOST'] ?? '';
$fullUrl = $scheme . '://' . $host . $api['path'];
// 读取调用次数
$relativePath = ltrim($api['path'], '/');
$counterFile = dirname($relativePath) . '/counter.dat';
$callCount = 0;
if (file_exists($counterFile)) {
$callCount = (int)trim(file_get_contents($counterFile));
}
?>