chg: dev: replace the legacy gos/web-socket-bundle & replace it with Mercure protocol #4
This commit is contained in:
@@ -12,7 +12,6 @@ namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
@@ -29,8 +28,11 @@ class GameController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
#[Autowire(env: 'APP_ENV')]
|
||||
private readonly string $env,
|
||||
private readonly RequestStack $request,
|
||||
private readonly string $env,
|
||||
#[Autowire(env: 'MERCURE_PUBLIC_URL')]
|
||||
private readonly string $mercurePublicUrl,
|
||||
#[Autowire(env: 'MERCURE_SUBSCRIBER_JWT')]
|
||||
private readonly string $mercureSubscriberJwt,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -42,8 +44,9 @@ class GameController extends AbstractController
|
||||
public function play(): Response
|
||||
{
|
||||
return $this->render('Game/play.html.twig', [
|
||||
'env' => $this->env,
|
||||
'ssl' => $this->request->getCurrentRequest()->isSecure() ? 'true' : 'false',
|
||||
'env' => $this->env,
|
||||
'mercure_hub_url' => $this->mercurePublicUrl,
|
||||
'mercure_subscriber_jwt' => $this->mercureSubscriberJwt,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user