Leverage the power of Symfony components within ApiPlatform
…So for example, here, when I
updated my pizza, I could have received a live event in the kitchen just by
adding one simple configuration on my annotation, meaning mercure true. In API
Platform we also have, it's, it's being prepared, it's…
|
mercure: |
|
hubs: |
|
default: |
|
url: '%env(MERCURE_URL)%' |
|
public_url: '%env(MERCURE_PUBLIC_URL)%' |
|
jwt: |
|
secret: '%env(MERCURE_JWT_SECRET)%' |
|
publish: '*' |
See Code Block in Script
But Mercure *is* on our list of things to cover in a different tutorial ;).
…In the Mercure's doc there are a feature named Discover which is not very clear for me of its purpose. So if I understand correctly, the client will make a request to a controller Discover, it will add the Link with Mercure public hub…
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.
|
|
// ... 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
|
|
// ... lines 1 - 75
|
|
private function getLocationNameChoices(string $location) |
|
{ |
|
$planets = [ |
|
'Mercury', |
|
'Venus', |
|
'Earth', |
|
'Mars', |
|
'Jupiter', |
|
'Saturn', |
|
'Uranus', |
|
'Neptune', |
|
]; |
|
|
|
$stars = [ |
|
'Polaris', |
|
'Sirius', |
|
'Alpha Centauari A', |
|
'Alpha Centauari B', |
|
'Betelgeuse', |
|
'Rigel', |
|
'Other' |
|
]; |
|
|
|
$locationNameChoices = [ |
|
'solar_system' => array_combine($planets, $planets), |
|
'star' => array_combine($stars, $stars), |
|
'interstellar_space' => null, |
|
]; |
|
|
|
return $locationNameChoices[$location]; |
|
} |
|
|
// ... lines 107 - 108
|
See Code Block in Script
Hi Ryan,
I'm working on getting connection between Mercure and React Native Mobile App and I am almost disappointed on finding a way how it works!
The Mercure debugging tools works on my local Host and I can publish data on client side (i…
What is better solution taking into account server load (Mercure Hub)? Users subscribe for one topic "product reviews" so that Mercure Pushes information to all of them and Turbo, based on frame ID, decides if do something with it or not - like shown in tutorial…
Hey there
In this course we do not cover Mercure but we do cover RabbitMQ in case you are interested. If you want to learn more about Mercure you can check the docs https://symfony.com/doc/current/mercure.html
Cheers!
Hey Himanshu,
If you're talking about web sockets - we have a few screencasts about Mercure Symfony component, kind of like web sockets but cooler :) You can check them here: https://symfonycasts.com/search?q=mercure&sort=most+relevant&types%5B%5D=video - you can leverage our advanced…
That is even better than a "pointer" ❤️
Pointer would be "mentioning mercure". Pointer squared would be your full text. Pointer cubed is what you did: giving even the links to specific videos.
Will definitively try it!
Thanks a ton.
Hi Nick,
I am very sad to hear that you had a bad experience with Mercure.
The interface is intentionally simple, to use the managed version you just need to set up a secure JWT key. Optionally, you can set a custom domain (for CORS…
Hi Ryan,
on the browser (Mercure Debugging Tools) works perfectly!
Thank you.
For people using windows like me:
The curl statement copied from the mercure website has to be edited to work in the windows command console.
1. replace all single quotes with double quotes
2. escape all double quotes within a string with a backslash "\"
3…
…problems getting the mercure hub running.
Trying to succeed doing the same thing in my ddev environment on the other hand is hopeless. Can anybody help me? I'm trying since two days to configure it.
I created a docker-compose.mercure.yaml in my…
Hi! will symfony cast ever tackle about mercure bundle? and when?
Hi, does this course cover live updates with mercure protocol
Hey! Is there really a Mercury tutorial planned? That would be great ! If yes, for when could we have access to it?
Do you plan to do a Mercury training again combining it with Turbo, or this time, with a traditional Symfony project not using…
x
131