Adding routes
To complete the implementation of the backend APIs, corresponding routes need to be declared and mounted on the Express app. In a separate file in the server/routes folder, first, declare and export the routes for these APIs, assigning the relevant controller functions that should be executed when a specific route is requested. Then, load these new routes on the Express app in the server/express.js file, just like the other existing routes in the application.
This will produce a working version of the new backend APIs that can be run and checked from a REST API client application. Then, these APIs can be used in the frontend views for the feature being developed, which you will add by extending the client code, as discussed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access