Route

In the backend, we will add a DELETE route that allows an authorized maker to delete one of their own games.

mern-vrgame/server/routes/game.routes.js:

router.route('/api/games/:gameId')    .delete(authCtrl.requireSignin, gameCtrl.isMaker, gameCtrl.remove)

The flow of the controller method execution on the server after receiving the DELETE request at 'api/games/:gameId' will be similar to the edit API, with the final call made to the remove controller method instead of update.

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.