PHP is just so easy to get things up and running quickly. it barely takes any configuration to get a new server configured to host web listeners that can run for years without worry.
<?php
header("Content-Type: application/json");
$input = file_get_contents("php://input");
try {
$data = json_decode($input, true);
if (isset($data['message']) && $data['message'] === "ping") {
echo json_encode(["response" => "pong"]);
} else {
http_response_code(400);
echo json_encode(["error" => "error"]);
}
} catch (Exception $e) {
http_response_code(400);
echo json_encode(["error" => "invalid"]);
}
then just run that in command line, add it to cron, and run automated security updates on the server. i have production servers with more complex APIs that have been running untouched for over a decade, and it took less than a day of work.