In the frontend code, we will add a fetch method to utilize this read API to retrieve the details of an individual game according to its ID.
mern-vrgame/client/game/api-game.js:
const read = (params, credentials) => { return fetch('/api/game/' + params.gameId, { method: 'GET' }).then((response) => { return response.json() }).catch((err) => console.log(err)) }
This read API will be used for the React views fetching a game detail and also the React 360 game view, which will render the game interface.