Add simple-status.php

This commit is contained in:
colin 2024-06-29 15:44:33 +00:00
commit eeb4f6156d
1 changed files with 22 additions and 0 deletions

22
simple-status.php Normal file
View File

@ -0,0 +1,22 @@
<?php
/*
Plugin Name: Simple Status
Description: Provides a custom endpoint for health checks.
Version: 1.0
Author: Colin
*/
function simple_status_endpoint() {
// Perform any necessary checks here
$status = array('status' => 'ok');
wp_send_json($status);
}
// Register the custom endpoint
add_action('rest_api_init', function () {
register_rest_route('simple/v1', '/status', array(
'methods' => 'GET',
'callback' => 'simple_status_endpoint',
));
});
?>