September 2017
Intermediate to advanced
450 pages
11h 24m
English
Let's create a /api/login route to authenticate a user using a username and password:
var express = require('express');var router = express.Router();var JSONAPISerializer = require('jsonapi-serializer').Serializer;var users = [{ id: "1", firstName: "Nicholas", lastName: "McClay", email: "nmcclay@nickmcclay.com", password: 'Secret', role: 'admin'}];var serializer = new JSONAPISerializer('users', { attributes: ['firstName', 'lastName',
Read now
Unlock full access