catalog.php 534 Bytes
<?php
    
    $response = array();
    $response["HAPI"] = "2.0"; 
    $response["status"] = array("code" => 1200, "msg" => "OK");

    $catalog = array();
    $datasets = file("AMDA_HAPI.list");
   
    foreach ($datasets as $dataset) {
        $catalog[] = array("id" => str_replace("\n","",$dataset));
    }

    $response["catalog"] = $catalog;
    
    header('Content-Type: application/json');
    header("Access-Control-Allow-Origin: *");
    header("Access-Control-Allow-Methods: GET");

    exit(json_encode($response));
?>