万本电子书0元读

万本电子书0元读

顶部广告

MEAN Web Development - Second Edition电子书

售       价:¥

3人正在读 | 0人评论 9.8

作       者:Amos Q. Haviv

出  版  社:Packt Publishing

出版时间:2016-11-01

字       数:451.7万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Develop your real-time MEAN application efficiently using a combination of MongoDB, Express, Angular, and Node About This Book Construct a fully-functional MEAN application by using its components along with the best third-party modules Harness the power of the JavaScript ecosystem to effectively run, build, and test your MEAN application Gain a deep, practical understanding of real-time web application development through real-world examples Who This Book Is For If you are a JavaScript developer who is interested in building modern web applications using MongoDB, Express, Angular 2, and Node 5.0, then this book is for you. You only need knowledge of JavaScript development. What You Will Learn Use MongoDB to store and retrieve your application's data Connect your Express application to MongoDB and use the Mongoose module Manage your users' authentication and offer them diverse login options using Passport Structure and use an Angular 2 application in your MEAN project Use Socket.io to create real-time communication between your client and server Test your application's Express and Angular 2 entities In Detail The MEAN stack is a collection of the most popular modern tools for web development that helps you build fast, robust, and maintainable web applications. Starting with the MEAN core frameworks, this pragmatic guide will explain the key concepts of each framework, how to set them up properly, and how to use popular modules to connect it all together. By following the real-world examples shown in this tutorial, you will scaffold your MEAN application architecture, add an authentication layer, and develop an MVC structure to support your project development. You will learn the best practices of maintaining clear and simple code and will see how to avoid common pitfalls. Finally, you will walk through the different tools and frameworks that will help expedite your daily development cycles. Watch how your application development grows by learning from the only guide that is solely orientated towards building a full, end-to-end, real-time application using the MEAN stack! Style and approach This comprehensive guide covers every part of the MEAN stack, and focuses on the gestalt power of the apps they can create through practical, real-world examples
目录展开

MEAN Web Development Second Edition

Table of Contents

MEAN Web Development Second Edition

Credits

About the Author

About the Reviewer

www.PacktPub.com

eBooks, discount offers, and more

Why subscribe?

Preface

What this book covers

What you need for this book

Who this book is for

Conventions

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Introduction to MEAN

Three-tier web application development

The evolution of JavaScript

Introduction to ECMAScript 2015

Modules

Classes

Arrow functions

Let and Const

Default, Rest, and Spread

Summary

Introducing MEAN

Installing MongoDB

Installing MongoDB on Windows

Running MongoDB manually

Running MongoDB as a Windows service

Installing MongoDB on Mac OS X and Linux

Installing MongoDB from binaries

Installing MongoDB using a package manager

Using the MongoDB shell

Installing Node.js

Installing Node.js on Windows

Installing Node.js on Mac OS X

Installing Node.js on Linux

Running Node.js

Introducing npm

Using npm

The installation process of npm

Installing a package using npm

Removing a package using npm

Updating a package using npm

Managing dependencies using the package.json file

Creating a package.json file

Installing the package.json dependencies

Updating the package.json file

Summary

2. Getting Started with Node.js

Introduction to Node.js

io.js and the Node.js foundation

Node.js ES6 support

Node.js LTS support

JavaScript event-driven programming

Node.js event-driven programming

JavaScript Closures

Node modules

CommonJS modules

Node.js core modules

Node.js third-party modules

Node.js file modules

Node.js folder modules

Developing Node.js web applications

Meet the Connect module

Connect middleware

Understanding the order of Connect middleware

Mounting Connect middleware

Summary

3. Building an Express Web Application

Introducing Express

Installing Express

Creating your first Express application

The application, request, and response objects

The application object

The request object

The response object

External middleware

Implementing the MVC pattern

The application folder structure

Horizontal folder structure

Vertical folder structure

File-naming conventions

Implementing the horizontal folder structure

Handling request routing

Adding the routing file

Configuring an Express application

Environment configuration files

Rendering views

Configuring the view system

Rendering EJS views

Serving static files

Configuring sessions

Summary

4. Introduction to MongoDB

Introduction to NoSQL

Introducing MongoDB

Key features of MongoDB

The BSON format

MongoDB ad hoc queries

MongoDB indexing

MongoDB replica set

MongoDB sharding

MongoDB 3.0

MongoDB shell

MongoDB databases

MongoDB collections

MongoDB CRUD operations

Creating a new document

Creating a document using insert()

Creating a document using update()

Creating a document using save()

Reading documents

Finding all the collection documents

Using an equality statement

Using query operators

Building AND/OR queries

Updating existing documents

Updating documents using update()

Updating documents using save()

Deleting documents

Deleting all documents

Deleting multiple documents

Deleting a single document

Summary

5. Introduction to Mongoose

Introducing Mongoose

Installing Mongoose

Connecting to MongoDB

Understanding Mongoose schemas

Creating the user schema and model

Registering the User model

Creating new users using save()

Finding multiple user documents using find()

Advanced querying using find()

Reading a single user document using findOne()

Updating an existing user document

Deleting an existing user document

Extending your Mongoose schema

Defining default values

Using schema modifiers

Predefined modifiers

Custom setter modifiers

Custom getter modifiers

Adding virtual attributes

Optimizing queries using indexes

Defining custom model methods

Defining custom static methods

Defining custom instance methods

Model validation

Predefined validators

Custom validators

Using Mongoose middleware

Using pre middleware

Using post middleware

Using Mongoose ref fields

Summary

6. Managing User Authentication Using Passport

Introducing Passport

Installing Passport

Configuring Passport

Understanding Passport strategies

Using Passport's local strategy

Installing Passport's local strategy module

Configuring Passport's local strategy

Adapting the User model

Creating the authentication views

Modifying the Users controller

Displaying flash error messages

Installing the Connect-Flash module

Configuring Connect-Flash module

Using Connect-Flash module

Wiring the user's routes

Understanding Passport OAuth strategies

Setting up OAuth strategies

Handling OAuth user creation

Using Passport's Facebook strategy

Installing Passport's Facebook strategy

Configuring Passport's Facebook strategy

Wiring Passport's Facebook strategy routes

Using Passport's Twitter strategy

Installing Passport's Twitter strategy

Configuring Passport's Twitter strategy

Wiring Passport's Twitter strategy routes

Using Passport's Google strategy

Installing Passport's Google strategy

Configuring Passport's Google strategy

Wiring Passport's Google strategy routes

Summary

7. Introduction to Angular

Introducing Angular 2

From Angular 1.x to Angular 2.x

Introduction to TypeScript

Types

Basic types

The any type

Interfaces

Decorators

Summary

Angular 2 Architecture

Angular 2 Modules

Angular 2 Components

Angular 2 Templates

Angular 2 data binding

Interpolation binding

Property binding

Event binding

Two-way binding

Angular 2 Directives

Attribute directives

Structural directives

Component directives

Angular 2 Services

Angular 2 Dependency Injection

Using Dependency Injection in Angular 2

Angular 2 Routing

Setup

Routes

Router outlet

Router links

Summary

The project setup

Configuring TypeScript

Configuring Express

Restructuring the application

Creating the application module

Creating the application component

Bootstrapping the application module

Starting your Angular application

Managing authentication

Rendering the user object

Modifying the users' server controller

Creating the authentication module

Creating the authentication component

Configuring the authentication routes

Creating the signin component

Creating the signup component

Creating the authentication service

Creating the home module

Creating the home component

Configuring the home routes

Refactoring the application module

Configuring the application routes

Summary

8. Creating a MEAN CRUD Module

Introducing CRUD modules

Setting up the Express components

Creating the Mongoose model

Setting up the Express controller

The error handling method of the Express controller

The create() method of the Express controller

The list() method of the Express controller

The read() middleware of the Express controller

The update() method of the Express controller

The delete() method of the Express controller

Implementing an authentication middleware

Implementing an authorization middleware

Wiring the Express routes

Configuring the Express application

Using the HTTP client

Reactive programming and Observables

The ReactiveX library

Using the http client

Implementing the Angular module

Creating the Angular module service

Implementing the Create subcomponent

Adding the template

Implementing the View subcomponent

Adding the template

Implementing the Edit subcomponent

Adding the template

Implementing the List subcomponent

Adding the template

Wrapping up

Summary

9. Adding Real-time Functionality Using Socket.io

Introducing WebSockets

Introducing Socket.io

The Socket.io server object

Socket.io handshaking

The Socket.io configuration middleware

The Socket.io client object

Socket.io events

Handling events

Emitting events

Socket.io namespaces

Socket.io server namespaces

Socket.io client namespaces

Socket.io rooms

Joining and leaving rooms

Emitting events to rooms

Installing Socket.io

Configuring the Socket.io server

Configuring the Socket.io session

Installing the connect-mongo and cookie-parser modules

Configuring the connect-mongo module

Configuring the Socket.io session

Building a Socket.io chat

Setting the event handlers of the chat server

Creating the Chat Angular module

Setting up the Socket.io client library

Creating the Chat module

Creating the Chat service

Creating the Chat component

Creating the Chat template

Adding the Chat routing configuration

Using the Chat module

Summary

10. Testing MEAN Applications

Introducing JavaScript testing

TDD, BDD, and unit testing

Test frameworks

Assertion libraries

Test runners

Testing your Express application

Introducing Mocha

Introducing Should.js

Introducing SuperTest

Installing Mocha

Installing the Should.js and SuperTest modules

Configuring your test environment

Writing your first Mocha test

Testing the Express model

Testing the Express controller

Running your Mocha test

Testing your Angular application

Introducing the Jasmine framework

Angular unit tests

Introducing Karma test runner

Installing the Karma command-line tool

Installing Karma's dependencies

Configuring the Karma test runner

Writing Angular unit tests

Testing components

Mocking backend data

Testing services

Testing routes

Testing directives

Testing pipes

Running your Angular unit tests

Angular E2E tests

Introducing the Protractor test runner

Installing the Protractor test runner

Configuring the Protractor test runner

Writing your first E2E test

Running your Angular E2E tests

Summary

11. Automating and Debugging MEAN Applications

Using NPM scripts

Introducing Webpack

Installing Webpack

Configuring Webpack

Introducing ESLint

Installing ESLint

Configuring ESLint

Using Nodemon

Debugging Express with V8 inspector

Debugging your application

Debugging Angular applications with Angular Augury

Using Angular Augury

The component tree

Router tree

Summary

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部