If there is an
inertia-server integration for your framework, setup may be already configured for you.Step 1: Pick initial rendering strategy
When youinertia.render, the resolved page is passed to the render
function you provided when setting up inertia-server. Here, you can
encode the page to JSON and send it with some html markup so it can be hydrated on the client.
Step 2: Prepare your inertia client entry
On the client, you will initialise your inertia app according to the official docs. For server side rednering, you will need to update your client entry to hydrate the page instead of rendering itStep 3: Configure asset handling
The tricky part after setting up your server and entry, is to coordinate your frontend assets with your server. If you render a page, you also have to send it’s assets to the client - scripts, styles, images, etc. In simple cases, you can inline all of them in your root template, and make sure that you serve them from your server.This config is partial to showcase the key parts. See examples in the
inertia-server repo for a complete reference.Vite config
Root template