<?php
/**
 * Minimal public version endpoint.
 * Avoid exposing PHP/Apache fingerprints to unauthenticated clients.
 */

define('access', 'api');
header('Content-Type: application/json');

try {
    if(!@include_once(rtrim(str_replace('\\','/', dirname(__DIR__)), '/') . '/includes/webengine.php')) {
        throw new Exception('Could not load WebEngine.');
    }
    new Handler();
    http_response_code(200);
    echo json_encode(array(
        'code' => 200,
        'service' => 'MU Nexora',
        'webengine' => __WEBENGINE_VERSION__,
    ), JSON_PRETTY_PRINT);
} catch(Exception $ex) {
    http_response_code(500);
    echo json_encode(array('code' => 500, 'error' => 'Service unavailable.'), JSON_PRETTY_PRINT);
}
