You are here

public function HealthController::content in Health check 8

Health check.

Return value

\Symfony\Component\HttpFoundation\Response The response.

1 string reference to 'HealthController::content'
health_check.routing.yml in ./health_check.routing.yml
health_check.routing.yml

File

src/Controller/HealthController.php, line 19

Class

HealthController
Controller for route that simply returns current time without page cache.

Namespace

Drupal\health_check\Controller

Code

public function content() {

  // Use plain response with timestamp.
  $response = new Response();
  $response->headers
    ->set('Content-Type', 'text/plain');
  $response
    ->setContent(time());
  return $response;
}