May 2018
Intermediate to advanced
470 pages
13h 54m
English
The user routes defined in the user.routes.js file will use express.Router() to declare the route paths with relevant HTTP methods, and assign the corresponding controller function that should be called when these requests are received by the server.
We will keep the user routes simple, by using the following:
The resulting user.routes.js code will look as follows (without the auth considerations that need to be added for protected routes).
mern-skeleton/server/routes/user.routes.js:
import express from 'express'import userCtrl from '../controllers/user.controller' ...
Read now
Unlock full access