9 Practical Node. js Projects

Saved in:
Bibliographic Details
Online Access: Full text (MCPHS users only)
Main Author: Hibbard, James
Other Authors: Kolce, James, White, Lukas, Wilken, Jeremy, Holmes, Simon, Wanyoike, Michael, Orac, Paul, Catanzariti, Patrick
Format: Electronic eBook
Language:English
Published: Sebastopol : SitePoint Pty, Limited, 2018
Subjects:
Local Note:ProQuest Ebook Central
Table of Contents:
  • 9 Practical Node.js Projects; Notice of Rights; Notice of Liability; Trademark Notice; About SitePoint; Preface; Who Should Read This Book?; Conventions Used; Code Samples; Tips, Notes, and Warnings; Chapter 1: Build a Simple Beginner App with Node, Bootstrap & MongoDB; by James Hibbard; What We'll Be Building; Basic Setup; Node.js; npm; MongoDB; A MongoDB GUI; Check that Everything Is Installed Correctly; Check the Database Connection Using Compass; Initialize the Application; Install Express; Install nodemon; Create Some Initial Files; Kick off the App; Basic Templating with Pug
  • Install Pug and Integrate It into the Express AppAlter the Route to Use Our Template; Define a Layout File for Pug; Use the Layout File from the Child Template; Dealing with Forms in Express; Handle Form Input; A Note about Request and Response Objects; Validating Form Input; Interact with a Database; Specify Connection Details; Connect to the Database; Define a Mongoose Schema; Save Data to the Database; Retrieve Data from the Database; Add HTTP Authentication; Serve Static Assets in Express; Style the App with Bootstrap; Conclusion
  • Chapter 2: How to Build a File Upload Form with Express and Dropzone.jsby Lukas White; Introducing DropzoneJS; Features; Browser Support; Installation; First Steps; Basic Usage; Basic Configuration Options; Enforcing Maximum File Size; Restricting to Certain File Types; Modifying the Size of the Thumbnail; Additional File Checks; Sending Additional Headers; Handling Fallbacks; Handling Errors; Overriding Messages and Translation; Events; A More Complex Validation Example: Image Dimensions; A Complete Example; Theming; A Simple Server-Side Upload Handler with Node.js and Express
  • Handling Upload SuccessHandling Upload Errors; Summary; Chapter 3: How to Build and Structure a Node.js MVC Application; by James Kolce; What is MVC?; Laying out the Foundation; Storing Our Settings; Defining the Routes; Building the Models; Setting up the database; Creating our Note model; Synchronizing the Database; Building the controllers; The Home Controller; Boilerplate of the Note Controller; The "create" function; The "read" function; The "update" function; The "delete" function; Using the Note controller in our routes; Building the Views; The note component; The base layout
  • The home viewThe note view; The JavaScript on the client; Adding support for views on the server; Setting the home view; Setting the note view: create function; Setting the note view: read function; Setting the note view: update function; Serving Static Files; Conclusion; Chapter 4: User Authentication with the MEAN Stack; by Simon Holmes & Jeremy Wilken; The MEAN Stack Authentication Flow; The Example Application; The Angular App; The REST API; Creating the MongoDB Data Schema with Mongoose; Managing the Password without Saving It; Generating a JSON Web Token (JWT)