May 2018
Intermediate to advanced
470 pages
13h 54m
English
The two auth APIs are defined in the auth.routes.js file using express.Router() to declare the route paths with relevant HTTP methods, and assigned corresponding auth controller functions that should be called when requests are received for these routes.
The auth routes are as follows:
The resulting mern-skeleton/server/routes/auth.routes.js file will be as follows:
import express from 'express'import authCtrl from '../controllers/auth.controller'const router = express.Router()router.route('/auth/signin') .post(authCtrl.signin)router.route('/auth/signout') ...Read now
Unlock full access