0

I'm trying to use symfony mercure bundle but it doesn't seem to work even with the example given on the documentation. here is my code in my controller

/**
 * @Route("/test", name="test")
 */
class TestController extends AbstractController
{

    public function __invoke(PublisherInterface $publisher): Response
    {
        $update = new Update(
            '/chat',
            json_encode(['status' => 'OutOfStock'])
        );

        // The Publisher service is an invokable object
        $publisher($update);

        return new Response('published!');
    }

}

and this the error i get.

HTTP/1.1 400 Bad Request returned for "http://localhost:3000/.well-known/mercure".

does anyone have any idea what's wrong?

error image here

here is a github link for a my project

Mikhail Prosalov
  • 4,155
  • 4
  • 29
  • 41

1 Answers1

0

I found ... there was an error in my environment variable

MERCURE_PUBLISH_URL = http: // localhost: 3000 / .well-known / mercury

instead of

MERCURE_PUBLISH_URL = http: // localhost: 3000 //. Well-known / mercury,

one slash too many . thank you all