tnort's avatar
Level 4

Laravel SSR Inertia

Hi all,

In the Laravel docs it says the following:

Server-Side Rendering If you're concerned about diving into Inertia because your application requires server-side rendering, don't worry. Inertia offers server-side rendering support. And, when deploying your application via Laravel Forge, it's a breeze to ensure that Inertia's server-side rendering process is always running.

I am concerned with the following "when deploying your application via Laravel Forge, it's a breeze to ensure that Inertia's server-side rendering process is always running" does it mean would still have to run two servers in parallel similar to as if I would build a SPA?

Regards, Mihail

0 likes
7 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

You need to both run the ssr server using npm and your regular php webserver yes

node public/js/ssr.js
1 like
tnort's avatar
Level 4

@Sinnbeck, I thought for some reason that Inertia would take care of it. But looks like Inertia is just the glue between Front and Back you don't have to build APIs.

Sinnbeck's avatar

@tudosm Exactly yes. Thats the point of it. It makes it very very easy to integrate laravel as you use regular laravel routing. But you need the node server to run the javascript on the server :)

1 like
Sinnbeck's avatar

@tudosm That is something different (everything requires a server these days :)). Its a hot reload server. It allows you to edit your js and css without running npm run build every time. Instead it updates the code and automatically reloads the web page

1 like
tnort's avatar
Level 4

@Sinnbeck, I was just confused since I decide to skip Inertial and go Laravel SSR. But I seem to get it now.

Sinnbeck's avatar

@tudosm Yeah vite isnt related to inertia. If you ever used laravel mix, then vite is just the replacement.

Please or to participate in this conversation.