Playing
07. Rebuilding assets and restarting Reverb

Transcript

00:00
So at this point, we've gone ahead and changed over our port and scheme.
00:03
Since we're using SSL, we've got this hooked up to the right host. The problem is all of our VConfig will be out of date. When we went ahead and deployed our application, we know that we run NPM run build to build all of our assets.
00:16
Another thing that you'll notice here is that when we toggled reverb within Forge, it will have added this artisan command to restart reverb. That means that between deploying any time, any of your config changes, this will reread this and of course, take the new configuration into effect.
00:34
So effectively, what we want to do is restart our server since we've changed over the port and scheme. And we also want to rebuild our assets. So on the client side, this reads in the new configuration
00:44
values from our JavaScript. So there's a couple of options. We can do this manually by issuing a command, or we can just redeploy our application.
00:53
I'm going to go ahead and do that now. Nothing's changed within the code, but this will rebuild our assets. And of course, restart our server. Let's wait for this to finish and then head over to our app.
01:03
Okay. Once that's finished, let's go and open our app backup, and we're going to bring up our console so we can check that everything is working nicely. Let's go ahead and give this a refresh.
01:13
And it looks like now we don't have any errors. And also over in our network tab, if we filter this by our web socket connections, you can see that we get a status of 101, which means this is connected successfully.
01:26
So moment of truth, we're just going to go ahead and hit broadcast a message. And as you can see, this is now pushing over to our reverb server. And of course, all of our connected clients are now picking up the events that are being pushed through.

Episode summary

In this episode, we're focusing on updating our app's assets and making sure Reverb is restarted after some configuration changes. We've just switched over to use SSL and updated our port and scheme. That means our config and built assets are now out of date, so it's important to rebuild them to pick up the latest settings.

We'll walk through how you can either manually rebuild your assets with a simple command, or just redeploy the app altogether—both will do the trick! We'll also see how Forge helps automate things by restarting Reverb when config changes are detected, so the new settings are loaded properly.

To wrap it all up, we'll open the app, check the browser console and network tab to make sure everything is connected and working with websockets. Finally, we'll trigger a broadcast to prove that everything is hooked up and running smoothly with Reverb. No more errors—and your app is ready to push events to all connected clients!

Episode discussion

No comments, yet. Be the first!