vlw.se/endpoints/update/GET.php
Victor Westerlund fef10a8ea8 feat: add endpoint for updating runtime stats (#35)
Replacing all GET update params with a single update endpoint that calls POST on all endpoints that trigger runtime stats

Reviewed-on: https://codeberg.org/vlw/vlw.se/pulls/35
2025-04-02 12:55:42 +00:00

26 lines
No EOL
615 B
PHP

<?php
use Reflect\{Response, Path, Call};
use ReflectRules\{Ruleset, Rules, Type};
use VLW\API\Endpoints;
require_once Path::root("src/API/Endpoints.php");
class GET_Update {
protected Ruleset $ruleset;
public function __construct() {
$this->ruleset = new Ruleset(strict: true);
$this->ruleset->validate_or_exit();
}
// Update all runtime database endpoints
public function main(): Response {
(new Call(Endpoints::SEARCH->value))->post();
(new Call(Endpoints::COFFEE_STATS->value))->post();
(new Call(Endpoints::ABOUT_LANGUAGES->value))->post();
return new Response();
}
}