update index controller, add health check
This commit is contained in:
@@ -12,16 +12,34 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
|
||||
#[Controller]
|
||||
class IndexController extends AbstractController
|
||||
{
|
||||
// #[RequestMapping('/', methods: ['GET', 'POST'])]
|
||||
public function index()
|
||||
{
|
||||
$user = $this->request->input('user', 'Hyperf');
|
||||
$method = $this->request->getMethod();
|
||||
|
||||
return [
|
||||
'method' => $method,
|
||||
'message' => "Hello {$user}.",
|
||||
'message' => "Dataflow App",
|
||||
];
|
||||
}
|
||||
|
||||
#[RequestMapping('/favicon.ico', methods: ['GET', 'POST'])]
|
||||
public function favicon()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
#[RequestMapping('/health', methods: 'GET')]
|
||||
public function health()
|
||||
{
|
||||
return [
|
||||
'message' => "System status ok",
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user