Server-side rendering with data
Search engine optimization is important for any web application that delivers content to its users, and wants to make the content easy to find. Generally, content on any webpage will have a better chance of getting more viewers if the content is easily readable to search engines. When a search engine bot accesses a web URL, it will get the server-side rendered output. Hence to make the content discoverable, the content should be part of the server-side rendered output.
In MERN Mediastream, we will use the case of making media details popular across search engine results, to demonstrate how to inject data into a server-side rendered view in a MERN application. We will focus on implementing server-side rendering with data injected for the PlayMedia
component that is returned at the '/media/:mediaId'
path. The general steps outlined here can be used to implement SSR with data for other views.
Route config
In order to load data for the React views when these are...