舉報

會員
Node.js Web Development
Thisbookisforanybodylookingforanalternativetothe"P"languages(Perl,PHP,andPython),oranyonelookingforanewparadigmofserver-sideapplicationdevelopment.YoushouldhaveatleastarudimentaryunderstandingofJavaScriptandwebapplicationdevelopment.
最新章節
- Leave a review - let other readers know what you think
- Other Books You May Enjoy
- Summary
- Using good cookie practices
- Scanning for known vulnerabilities
- Sequelize deprecation warning regarding operator injection attack
品牌:中圖公司
上架時間:2021-06-25 20:58:44
出版社:Packt Publishing
本書數字版權由中圖公司提供,并由其授權上海閱文信息技術有限公司制作發行
- Leave a review - let other readers know what you think 更新時間:2021-06-25 21:54:45
- Other Books You May Enjoy
- Summary
- Using good cookie practices
- Scanning for known vulnerabilities
- Sequelize deprecation warning regarding operator injection attack
- Denying SQL injection attacks
- Addressing Cross-Site Request Forgery (CSRF) attacks
- Mitigating XSS attacks with Helmet
- Improving HTTPS with Strict Transport Security
- Using Helmet to remove the X-Powered-By header
- Using Helmet to set the X-Frame-Options header
- Using Helmet to set the X-DNS-Prefetch-Control header
- Using Helmet to set the Content-Security-Policy header
- Put on your Helmet for across-the-board security
- Adding HTTPS support to Notes
- Cross-container mounting of Let's Encrypt directories to the notes container
- A Docker container to manage Let's Encrypt SSL certificates
- Associating a domain name with Docker-based cloud hosting
- HTTPS/TLS/SSL using Let's Encrypt
- Security
- Summary
- Taking screenshots
- Avoiding WebSockets conflicts
- Inserting pauses
- Tracing events on the Page and the Puppeteer instance
- Configuring timeouts
- Mitigating/preventing spurious test errors in Puppeteer scripts
- The Add Note scenario
- Running the login scenario
- Puppeteer test script for Notes
- Improving testability in the Notes UI
- Setting up Puppeteer
- Frontend headless browser testing with Puppeteer
- Automating test results reporting
- Testing REST backend services
- MongoDB setup under Docker and testing Notes against MongoDB
- Executing tests under Docker Compose
- Docker Compose to orchestrate test infrastructure
- Using Docker to manage test infrastructure
- Testing database models
- More tests for the Notes model
- Configuring and running tests
- Notes model test suite
- Mocha and Chai- – the chosen test tools
- Testing a Notes model
- Assert – the basis of testing methodologies
- Unit Testing and Functional Testing
- Summary
- Deploying to cloud hosting with Docker compose
- Running the Notes application with Docker compose
- Docker compose files
- Deploying to the cloud with Docker compose
- Docker deployment of background services
- Controlling the location of MySQL data volumes
- Dockerizing the Notes application
- MySQL container for the Notes application
- Creating FrontNet for the Notes application
- Exploring Authnet
- Building and running the authentication service Docker container
- Configuring the authentication service for Docker
- Dockerfile for the authentication service
- The db-userauth container
- Linking Docker containers
- Script execution on Windows
- Initializing AuthNet
- MySQL container for Docker
- Creating the AuthNet for the user authentication service
- Kicking the tires of Docker
- Starting Docker with Docker for Windows/macOS
- Installing Docker on your laptop
- Node.js microservice deployment with Docker
- Setting up PM2 to manage Node.js processes
- Adjusting Twitter authentication to work on the server
- Setting up Notes and user authentication on the server
- Installing Node.js on Ubuntu
- Prerequisite – provisioning the databases
- Traditional Linux Node.js service deployment
- Notes application architecture and deployment considerations
- Deploying Node.js Applications
- Summary
- Other applications of Modal windows
- Running Notes and passing messages
- Sending displaying and deleting messages
- Using a Modal window to compose messages
- Changing the note view template for messages
- Adding messages to the Notes router
- Data model for storing messages
- Inter-user chat and commenting for Notes
- Running Notes with real-time updates while viewing a note
- Changing the note view template for real-time action
- Real-time action while viewing notes
- Running Notes with real-time homepage updates
- Changing the homepage and layout templates
- Real-time changes in the Notes home page
- The Notes model as an EventEmitter class
- Real-time updates on the Notes homepage
- Initializing Socket.IO with Express
- Introducing Socket.IO
- Dynamic Client/Server Interaction with Socket.IO
- Summary
- The Notes application stack
- Securely keeping secrets and passwords
- Implementing TwitterStrategy
- Registering an application with Twitter
- Twitter login support for the Notes application
- Running the Notes application with user authentication
- View template changes supporting login/logout
- Login/logout changes required in routes/notes.mjs
- Login/logout changes in routes/index.mjs
- Login/logout changes to app.js
- Login and logout routing functions
- Accessing the user authentication REST API
- Login support for the Notes application
- Scripts to test and administer the user authentication server
- A REST server for user information
- User information model
- Creating a user information microservice
- Multiuser Authentication the Microservice Way
- Summary
- Running the Notes application with MongoDB
- MongoDB model for the Notes application
- Storing notes in MongoDB
- Running the Notes application with Sequelize
- Configuring a Sequelize database connection
- Sequelize model for the Notes application
- Storing notes the ORM way with Sequelize
- Running Notes with SQLite3
- SQLite3 model code
- SQLite3 database schema
- Storing notes in SQL with SQLite3
- Storing notes with the LevelUP data store
- Running the Notes application with filesystem storage
- Dynamic import of ES6 modules
- Storing notes in the filesystem
- Rewriting router modules as ES6 modules
- Rewriting models code as ES6 modules
- Rewriting bin/www as an ES6 module
- Rewriting app.js as an ES6 module
- Using the ES6 module format
- Unhandled Promise rejections
- Uncaught exceptions
- Capturing stdout and stderr
- Debugging messages
- Request logging with Morgan
- Logging
- Data storage and asynchronous code
- Data Storage and Retrieval
- Summary
- Pre-built custom Bootstrap themes
- Building a customized Bootstrap
- Cleaning up the delete-note window
- Cleaning up the add/edit note form
- Cleaning up the Note viewing experience
- Improving the Notes list on the front page
- Responsive page header navigation bar
- Using icon libraries and improving visual appeal
- Responsive page structure for the Notes application
- Laying the Bootstrap grid foundation
- Mobile-first design for the Notes application
- Flexbox and CSS Grids
- Alternative layout frameworks
- Adding Bootstrap to application templates
- Setting it up
- Using Twitter Bootstrap on the Notes application
- Mobile-first paradigm
- Problem – the Notes app isn't mobile friendly
- Implementing the Mobile-First Paradigm
- Summary
- Scaling up – running multiple Notes instances
- Theming your Express application
- Deleting notes – destroy
- Editing an existing note – update
- Viewing notes – read
- Adding a new note – create
- The Notes home page
- Filling out the in-memory Notes model
- Understanding ES-2015 class definitions
- Your first Notes model
- Creating the Notes application
- Express and the MVC paradigm
- Promises and generators birthed async functions
- Flattening our asynchronous code
- Promises and error handling
- Promises async functions and Express router functions
- Your First Express Application
- Summary
- Some RESTful modules and frameworks
- Refactoring the Fibonacci application for REST
- Implementing a simple REST server with Express
- Calling a REST backend service from an Express application
- Making HTTP Client requests
- Algorithmic refactoring
- Computationally intensive code and the Node.js event loop
- Calculating the Fibonacci sequence with an Express application
- Error handling
- Middleware and request paths
- The Express middleware
- Walking through the default Express application
- Setting environment variables in Windows cmd.exe command line
- Getting started with Express
- Web application frameworks
- HTTP Sniffer – listening to the HTTP conversation
- ES2015 multiline and template strings
- HTTP server applications
- The EventEmitter theory
- The EventEmitter Class
- JavaScript classes and class inheritance
- Sending and receiving events with EventEmitters
- HTTP Servers and Clients
- Summary
- The Yarn package management system
- Explicitly specifying package dependency version numbers
- Publishing an npm package
- Declaring Node.js version compatibility
- Initializing a new npm package
- Installing packages from outside the npm repository
- Updating outdated packages you've installed
- Avoiding modifications to the PATH variable
- Configuring the PATH variable on Windows
- Configuring the PATH variable to handle commands installed by modules
- Packages that install commands
- Fixing bugs by updating package dependencies
- Automatically updating package.json dependencies
- Maintaining package dependencies with npm
- Avoiding global module installation
- Global package installs
- Installing a package by version number
- Installing an npm package
- Other npm commands
- Finding npm packages
- The npm package format
- npm - the Node.js package management system
- The import.meta feature
- Dynamic imports with import()
- Hybrid CommonJS/Node.js/ES6 module scenarios
- Finding and loading ES6 modules using import
- An example of application directory structure
- Module identifiers and pathnames
- Directories as modules
- Modules baked into Node.js binary
- File modules
- Finding and loading CommonJS and JSON modules using require
- Demonstrating module-level encapsulation
- Supporting ES6 modules on older Node.js versions
- JSON modules
- ES6 module format
- CommonJS/Node.js module format
- CommonJS and ES2015 module formats
- Defining a module
- Node.js Modules
- Summary
- Using Babel to use experimental JavaScript features
- Node.js ECMAScript 2015/2016/2017 and beyond
- NPM – the Node.js package manager
- Launching a server with Node.js
- Conversion to async functions and the Promise paradigm
- Running a simple script with Node.js
- Node.js's command-line tools
- Running and testing commands
- Editors and debuggers
- Node.js versions policy and what to use
- Native code modules and node-gyp
- Installing nvm on Windows
- Installing multiple Node.js instances with nvm
- Installing from source on Windows
- Installing from source for all POSIX-like systems
- Installing developer tools on macOS
- Installing prerequisites
- Installing from source on POSIX-like systems
- Installing the Node.js distribution from nodejs.org
- Opening an administrator-privileged PowerShell on Windows
- Installing Node.js in the Windows Subsystem for Linux (WSL)
- Installing on Linux *BSD or Windows from package management systems
- Installing on macOS with Homebrew
- Installing on macOS with MacPorts
- Installing Node.js using package managers
- System requirements
- Setting up Node.js
- Summary
- Node.js and the Twelve-Factor app model
- Node.js the microservice architecture and easily testable systems
- Deploying ES2015/2016/2017/2018 JavaScript code
- Embracing advances in the JavaScript language
- Server utilization the business bottom line and green web hosting
- Is Node.js a cancerous scalability disaster?
- Performance and utilization
- Threaded versus event-driven architecture
- Node.js is stronger for having survived a major schism and hostile fork
- Microservice architecture
- Leaner asynchronous event-driven model
- Leveraging Google's investment in V8
- JavaScript at all levels of the stack
- Popularity
- Why should you use Node.js?
- Server-side JavaScript
- The capabilities of Node.js
- About Node.js
- Reviews
- Get in touch
- Conventions used
- Download the example code files
- To get the most out of this book
- What this book covers
- Who this book is for
- Preface
- Packt is searching for authors like you
- About the reviewer
- About the author
- Contributors
- PacktPub.com
- Why subscribe?
- Packt Upsell
- Dedication
- 版權信息
- 封面
- 封面
- 版權信息
- Dedication
- Packt Upsell
- Why subscribe?
- PacktPub.com
- Contributors
- About the author
- About the reviewer
- Packt is searching for authors like you
- Preface
- Who this book is for
- What this book covers
- To get the most out of this book
- Download the example code files
- Conventions used
- Get in touch
- Reviews
- About Node.js
- The capabilities of Node.js
- Server-side JavaScript
- Why should you use Node.js?
- Popularity
- JavaScript at all levels of the stack
- Leveraging Google's investment in V8
- Leaner asynchronous event-driven model
- Microservice architecture
- Node.js is stronger for having survived a major schism and hostile fork
- Threaded versus event-driven architecture
- Performance and utilization
- Is Node.js a cancerous scalability disaster?
- Server utilization the business bottom line and green web hosting
- Embracing advances in the JavaScript language
- Deploying ES2015/2016/2017/2018 JavaScript code
- Node.js the microservice architecture and easily testable systems
- Node.js and the Twelve-Factor app model
- Summary
- Setting up Node.js
- System requirements
- Installing Node.js using package managers
- Installing on macOS with MacPorts
- Installing on macOS with Homebrew
- Installing on Linux *BSD or Windows from package management systems
- Installing Node.js in the Windows Subsystem for Linux (WSL)
- Opening an administrator-privileged PowerShell on Windows
- Installing the Node.js distribution from nodejs.org
- Installing from source on POSIX-like systems
- Installing prerequisites
- Installing developer tools on macOS
- Installing from source for all POSIX-like systems
- Installing from source on Windows
- Installing multiple Node.js instances with nvm
- Installing nvm on Windows
- Native code modules and node-gyp
- Node.js versions policy and what to use
- Editors and debuggers
- Running and testing commands
- Node.js's command-line tools
- Running a simple script with Node.js
- Conversion to async functions and the Promise paradigm
- Launching a server with Node.js
- NPM – the Node.js package manager
- Node.js ECMAScript 2015/2016/2017 and beyond
- Using Babel to use experimental JavaScript features
- Summary
- Node.js Modules
- Defining a module
- CommonJS and ES2015 module formats
- CommonJS/Node.js module format
- ES6 module format
- JSON modules
- Supporting ES6 modules on older Node.js versions
- Demonstrating module-level encapsulation
- Finding and loading CommonJS and JSON modules using require
- File modules
- Modules baked into Node.js binary
- Directories as modules
- Module identifiers and pathnames
- An example of application directory structure
- Finding and loading ES6 modules using import
- Hybrid CommonJS/Node.js/ES6 module scenarios
- Dynamic imports with import()
- The import.meta feature
- npm - the Node.js package management system
- The npm package format
- Finding npm packages
- Other npm commands
- Installing an npm package
- Installing a package by version number
- Global package installs
- Avoiding global module installation
- Maintaining package dependencies with npm
- Automatically updating package.json dependencies
- Fixing bugs by updating package dependencies
- Packages that install commands
- Configuring the PATH variable to handle commands installed by modules
- Configuring the PATH variable on Windows
- Avoiding modifications to the PATH variable
- Updating outdated packages you've installed
- Installing packages from outside the npm repository
- Initializing a new npm package
- Declaring Node.js version compatibility
- Publishing an npm package
- Explicitly specifying package dependency version numbers
- The Yarn package management system
- Summary
- HTTP Servers and Clients
- Sending and receiving events with EventEmitters
- JavaScript classes and class inheritance
- The EventEmitter Class
- The EventEmitter theory
- HTTP server applications
- ES2015 multiline and template strings
- HTTP Sniffer – listening to the HTTP conversation
- Web application frameworks
- Getting started with Express
- Setting environment variables in Windows cmd.exe command line
- Walking through the default Express application
- The Express middleware
- Middleware and request paths
- Error handling
- Calculating the Fibonacci sequence with an Express application
- Computationally intensive code and the Node.js event loop
- Algorithmic refactoring
- Making HTTP Client requests
- Calling a REST backend service from an Express application
- Implementing a simple REST server with Express
- Refactoring the Fibonacci application for REST
- Some RESTful modules and frameworks
- Summary
- Your First Express Application
- Promises async functions and Express router functions
- Promises and error handling
- Flattening our asynchronous code
- Promises and generators birthed async functions
- Express and the MVC paradigm
- Creating the Notes application
- Your first Notes model
- Understanding ES-2015 class definitions
- Filling out the in-memory Notes model
- The Notes home page
- Adding a new note – create
- Viewing notes – read
- Editing an existing note – update
- Deleting notes – destroy
- Theming your Express application
- Scaling up – running multiple Notes instances
- Summary
- Implementing the Mobile-First Paradigm
- Problem – the Notes app isn't mobile friendly
- Mobile-first paradigm
- Using Twitter Bootstrap on the Notes application
- Setting it up
- Adding Bootstrap to application templates
- Alternative layout frameworks
- Flexbox and CSS Grids
- Mobile-first design for the Notes application
- Laying the Bootstrap grid foundation
- Responsive page structure for the Notes application
- Using icon libraries and improving visual appeal
- Responsive page header navigation bar
- Improving the Notes list on the front page
- Cleaning up the Note viewing experience
- Cleaning up the add/edit note form
- Cleaning up the delete-note window
- Building a customized Bootstrap
- Pre-built custom Bootstrap themes
- Summary
- Data Storage and Retrieval
- Data storage and asynchronous code
- Logging
- Request logging with Morgan
- Debugging messages
- Capturing stdout and stderr
- Uncaught exceptions
- Unhandled Promise rejections
- Using the ES6 module format
- Rewriting app.js as an ES6 module
- Rewriting bin/www as an ES6 module
- Rewriting models code as ES6 modules
- Rewriting router modules as ES6 modules
- Storing notes in the filesystem
- Dynamic import of ES6 modules
- Running the Notes application with filesystem storage
- Storing notes with the LevelUP data store
- Storing notes in SQL with SQLite3
- SQLite3 database schema
- SQLite3 model code
- Running Notes with SQLite3
- Storing notes the ORM way with Sequelize
- Sequelize model for the Notes application
- Configuring a Sequelize database connection
- Running the Notes application with Sequelize
- Storing notes in MongoDB
- MongoDB model for the Notes application
- Running the Notes application with MongoDB
- Summary
- Multiuser Authentication the Microservice Way
- Creating a user information microservice
- User information model
- A REST server for user information
- Scripts to test and administer the user authentication server
- Login support for the Notes application
- Accessing the user authentication REST API
- Login and logout routing functions
- Login/logout changes to app.js
- Login/logout changes in routes/index.mjs
- Login/logout changes required in routes/notes.mjs
- View template changes supporting login/logout
- Running the Notes application with user authentication
- Twitter login support for the Notes application
- Registering an application with Twitter
- Implementing TwitterStrategy
- Securely keeping secrets and passwords
- The Notes application stack
- Summary
- Dynamic Client/Server Interaction with Socket.IO
- Introducing Socket.IO
- Initializing Socket.IO with Express
- Real-time updates on the Notes homepage
- The Notes model as an EventEmitter class
- Real-time changes in the Notes home page
- Changing the homepage and layout templates
- Running Notes with real-time homepage updates
- Real-time action while viewing notes
- Changing the note view template for real-time action
- Running Notes with real-time updates while viewing a note
- Inter-user chat and commenting for Notes
- Data model for storing messages
- Adding messages to the Notes router
- Changing the note view template for messages
- Using a Modal window to compose messages
- Sending displaying and deleting messages
- Running Notes and passing messages
- Other applications of Modal windows
- Summary
- Deploying Node.js Applications
- Notes application architecture and deployment considerations
- Traditional Linux Node.js service deployment
- Prerequisite – provisioning the databases
- Installing Node.js on Ubuntu
- Setting up Notes and user authentication on the server
- Adjusting Twitter authentication to work on the server
- Setting up PM2 to manage Node.js processes
- Node.js microservice deployment with Docker
- Installing Docker on your laptop
- Starting Docker with Docker for Windows/macOS
- Kicking the tires of Docker
- Creating the AuthNet for the user authentication service
- MySQL container for Docker
- Initializing AuthNet
- Script execution on Windows
- Linking Docker containers
- The db-userauth container
- Dockerfile for the authentication service
- Configuring the authentication service for Docker
- Building and running the authentication service Docker container
- Exploring Authnet
- Creating FrontNet for the Notes application
- MySQL container for the Notes application
- Dockerizing the Notes application
- Controlling the location of MySQL data volumes
- Docker deployment of background services
- Deploying to the cloud with Docker compose
- Docker compose files
- Running the Notes application with Docker compose
- Deploying to cloud hosting with Docker compose
- Summary
- Unit Testing and Functional Testing
- Assert – the basis of testing methodologies
- Testing a Notes model
- Mocha and Chai- – the chosen test tools
- Notes model test suite
- Configuring and running tests
- More tests for the Notes model
- Testing database models
- Using Docker to manage test infrastructure
- Docker Compose to orchestrate test infrastructure
- Executing tests under Docker Compose
- MongoDB setup under Docker and testing Notes against MongoDB
- Testing REST backend services
- Automating test results reporting
- Frontend headless browser testing with Puppeteer
- Setting up Puppeteer
- Improving testability in the Notes UI
- Puppeteer test script for Notes
- Running the login scenario
- The Add Note scenario
- Mitigating/preventing spurious test errors in Puppeteer scripts
- Configuring timeouts
- Tracing events on the Page and the Puppeteer instance
- Inserting pauses
- Avoiding WebSockets conflicts
- Taking screenshots
- Summary
- Security
- HTTPS/TLS/SSL using Let's Encrypt
- Associating a domain name with Docker-based cloud hosting
- A Docker container to manage Let's Encrypt SSL certificates
- Cross-container mounting of Let's Encrypt directories to the notes container
- Adding HTTPS support to Notes
- Put on your Helmet for across-the-board security
- Using Helmet to set the Content-Security-Policy header
- Using Helmet to set the X-DNS-Prefetch-Control header
- Using Helmet to set the X-Frame-Options header
- Using Helmet to remove the X-Powered-By header
- Improving HTTPS with Strict Transport Security
- Mitigating XSS attacks with Helmet
- Addressing Cross-Site Request Forgery (CSRF) attacks
- Denying SQL injection attacks
- Sequelize deprecation warning regarding operator injection attack
- Scanning for known vulnerabilities
- Using good cookie practices
- Summary
- Other Books You May Enjoy
- Leave a review - let other readers know what you think 更新時間:2021-06-25 21:54:45