Running the Mercure Service in the symfony Binary
Mercure itself is a "service" or "server" - kind of like MySQL or Elasticsearch.
The Mercure server is called the "hub"... and there are several good ways to get
it running. First, they have a managed version where they ...
Mercure Pushing Stream Updates Async
... web server to push information
to a browser without us needing to make an Ajax call to ask for it.
And fortunately, in the Symfony world, we have great support for a technology that
enables server-sent events: Mercure ...
Mercure Hub's JWT Authorization
Can anyone publish a message to any topic on a Mercure hub? Definitely not.
So how does the Mercure Hub know that we are allowed to publish this message?
It's entirely thanks to this long string that we're passing to ...
Publishing Mercure Updates in PHP
We now know that we can easily subscribe to a Mercure topic in JavaScript.
And, if we publish a message to that topic with <turbo-stream> HTML in it,
our JavaScript will instantly notice & process it. Sweet!
So far ...
Entity Broadcast
... There's one super cool feature of the Turbo Mercure UX package that we installed
earlier that we have not talked about. And it's this: the ability to publish a
Mercure update automatically whenever an entity is created ...
Turbo Stream Responses
... similar to how the Turbo and
Mercure integration works. If you don't know, Mercure is a tool that allows you
to get real-time updates on your front end... kind of like web sockets, but cooler.
And Mercure pairs really ...
Listening Publishing
The purpose of Mercure is to have a hub where we can subscribe - or listen - to
messages and also publish messages.
Here's our high-level goal, it's three steps. First, set up some JavaScript that
listens to a "topic ...
Symfony Live Paris 2019 French
... Elasticsearch, Mercure et Panther, RabbitMQ et bien d’autres sujets tout aussi passionnants !
Vous êtes prêt à regarder (ou revoir) les présentations ? Les vidéos sont disponibles pour tous les abonnés SymfonyCasts et à tous ...
Symfony Live Lille 2019 French
... des sujets sur Symfony (évidemment), mais aussi Mercure, Doctrine, API Platform ou encore React et Redux ainsi que des bonnes pratiques sur les meilleurs bundles et outils pour vos applications Symfony, et d’autres ...
|
// ... lines 1 - 29
|
|
|
|
|
|
|
|
MERCURE_URL=https://127.0.0.1:8000/.well-known/mercure |
|
|
|
MERCURE_PUBLIC_URL=https://127.0.0.1:8000/.well-known/mercure |
|
|
|
MERCURE_JWT_SECRET="!ChangeMe!" |
|
|
See Code Block in Script
Turbo Stream for Instant Review Update
... the controller.... so we chose to return a
stream... which means that the stream needs to update both sections of the page.
Okay. So why are we talking about all of this again? Because now that we have
Mercure running, we ...
... As symfony/ux-turbo-mercure has been abandoned (files are located in symfony/ux-turbo), you now should run `composer req symfony/mercure-bundle` instead.
Also, set `enabled` to `true` in assets/controllers.json for the mercure-turbo-stream config.
... what I try. Can you offer some assistance? Here are snippets of some relevant configurations:
composer.json - Expected version when using Symfony 5.4.*
```
"symfony/mercure-bundle": "^0.3.5",
```
package.json ...
Hey wxcvbn612!
Hmm. I believe the problem is that Mercure is running in http and your site is running on https. This different "scheme", iirc, makes Mercure and your site work like they're on different domains, which ...
Hi
Thank you for this great tutorial.
Is it possible to implement the json_login authentication with Mercure knowing that API Platform doc https://api-platform.com/docs/core/mercure/#installing-mercure-support, they are using JWT. My main goal is to secure the API and notify users when a new article is created. Thanks ...
Hey Rodrypaladin,
Hm, `clear:cache` may not work somethings... could you try `rm -rf var/cache/`?
Stil the same error? Do you have `symfony/mercure` or `symfony/mercure-bundle` package installed in your project ...
Hello team :)
I'm using the symfony CLI 4.26 and when i try to access `localhost:8000/.well-known/mercure`, it's a 404 i receive.
Then, when i try to dump the env vars, searching for `MERCURE`, it returns an empty ...
Hey Tristan P.!
Ok, let's see! I might have a simple explanation for you, depending on what you're trying to achieve.
It is this: in order to use the Mercure hub in your dev environment with the symfony binary web ...
108
mercure
Filter Results