Quite a useful pattern where the server is responsible and controls what is shown to the user as part of the UI. A simple example is added here. A video explanation can be found in my Youtube Channel
Run the example by running below commands in separate terminals
npm run dev
npm run server