User CRUD API 

The user API endpoints exposed by the Express app will allow the frontend to do CRUD operations on the documents generated according to the user model. To implement these working endpoints, we will write Express routes and corresponding controller callback functions that should be executed when HTTP requests come in for these declared routes. In this section, we will look at how these endpoints will work without any auth restrictions.

The user API routes will be declared using Express router in server/routes/user.routes.js, and then mounted on the Express app we configured in server/express.js.

mern-skeleton/server/express.js:

import userRoutes from './routes/user.routes'...app.use('/', userRoutes)...

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.