| 1 |
<?php |
| 2 |
|
| 3 |
namespace Leadin\api; |
| 4 |
|
| 5 |
use Leadin\api\Base_Api_Controller; |
| 6 |
|
| 7 |
/** |
| 8 |
* Healthcheck deployment endpoint |
| 9 |
*/ |
| 10 |
class Healthcheck_Api_Controller extends Base_Api_Controller { |
| 11 |
|
| 12 |
/** |
| 13 |
* Class constructor, register route. |
| 14 |
*/ |
| 15 |
public function __construct() { |
| 16 |
self::register_leadin_route( |
| 17 |
'/healthcheck', |
| 18 |
\WP_REST_Server::READABLE, |
| 19 |
array( $this, 'get_healthcheck_request' ) |
| 20 |
); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Callback for healtcheck endpoint. |
| 25 |
* leadin/v1/healthcheck Method:GET. |
| 26 |
* |
| 27 |
* @return string OK response message. |
| 28 |
*/ |
| 29 |
public function get_healthcheck_request() { |
| 30 |
return new \WP_REST_Response( 'OK', 200 ); |
| 31 |
} |
| 32 |
|
| 33 |
} |
| 34 |
|