May 2018
Intermediate to advanced
470 pages
13h 54m
English
The create order API route is declared in server/routes/order.routes.js. The order routes will be very similar to the user routes. To load the order routes in the Express app, we need to mount the routes in express.js, like we did for the auth and user routes.
mern-marketplace/server/express.js:
app.use('/', orderRoutes)
A number of actions, in the following sequence, take place when the create order API receives a POST request at /api/orders/:userId:
Read now
Unlock full access