Skip to content

Instantly share code, notes, and snippets.

@GeeH
Created August 14, 2016 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GeeH/4fb87425fbab9b75957ccb755572ad59 to your computer and use it in GitHub Desktop.
Save GeeH/4fb87425fbab9b75957ccb755572ad59 to your computer and use it in GitHub Desktop.
<?php
namespace App\Action;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\Response\JsonResponse;
class PingAction
{
const ROUTE_NAME = 'api.ping';
const ROUTE_PATH = '/api/ping';
const ROUTE_METHODS = ['GET'];
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
return new JsonResponse(['ack' => time()]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment