<?php

use MintyPHP\Http\ApiBootstrap;
use MintyPHP\Http\ApiResponse;
use MintyPHP\Service\Settings\SettingsAppGateway;

ApiBootstrap::init(requireAuth: false);
ApiResponse::requireMethod('GET');

$settingsAppGateway = app(SettingsAppGateway::class);

header('Cache-Control: public, max-age=60');

ApiResponse::success([
    'data' => [
        'app_title' => $settingsAppGateway->getAppTitle(),
        'app_primary_color' => $settingsAppGateway->getAppPrimaryColor(),
        'default_theme' => $settingsAppGateway->getAppTheme(),
        'registration_enabled' => $settingsAppGateway->isRegistrationEnabled(),
    ],
]);
