دسترسی نامحدود
برای کاربرانی که ثبت نام کرده اند
برای ارتباط با ما می توانید از طریق شماره موبایل زیر از طریق تماس و پیامک با ما در ارتباط باشید
در صورت عدم پاسخ گویی از طریق پیامک با پشتیبان در ارتباط باشید
برای کاربرانی که ثبت نام کرده اند
درصورت عدم همخوانی توضیحات با کتاب
از ساعت 7 صبح تا 10 شب
ویرایش: 5
نویسندگان: David Herron
سری:
ISBN (شابک) : 1838987576, 9781838987572
ناشر: Packt Publishing
سال نشر: 2020
تعداد صفحات: 746
زبان: English
فرمت فایل : PDF (درصورت درخواست کاربر به PDF، EPUB یا AZW3 تبدیل می شود)
حجم فایل: 7 مگابایت
در صورت تبدیل فایل کتاب Node.js Web Development: Server-side web development made easy with Node 14 using practical examples به فرمت های PDF، EPUB، AZW3، MOBI و یا DJVU می توانید به پشتیبان اطلاع دهید تا فایل مورد نظر را تبدیل نمایند.
توجه داشته باشید کتاب Node.js توسعه وب: توسعه وب سمت سرور با استفاده از مثالهای عملی با Node 14 آسان شد نسخه زبان اصلی می باشد و کتاب ترجمه شده به فارسی نمی باشد. وبسایت اینترنشنال لایبرری ارائه دهنده کتاب های زبان اصلی می باشد و هیچ گونه کتاب ترجمه شده یا نوشته شده به فارسی را ارائه نمی دهد.
با استفاده از Node.js، Express.js، و آخرین تکنیکهای ECMAScript، برنامههای کاربردی وب مقیاسپذیر بسازید، همراه با استقرار برنامههای کاربردی با AWS و Docker با این نسخه پنجم بهروزرسانی شده
Node.js انتخاب پیشرو پلت فرم توسعه وب سمت سرور، که توسعه دهندگان را قادر می سازد از ابزارها و پارادایم های یکسانی برای نرم افزار سمت سرور و سمت سرویس گیرنده استفاده کنند. این نسخه پنجم به روز شده توسعه وب Node.js بر ویژگی های جدید Node.js 14، Express 4.x و ECMAScript تمرکز دارد و شما را با مفاهیم مدرن، تکنیک ها و بهترین روش ها برای استفاده از Node.js آشنا می کند.
این کتاب با کمک به شما برای درک مفاهیم ساخت برنامه های وب سمت سرور با Node.js شروع می شود. شما یاد خواهید گرفت که چگونه یک برنامه وب Node.js کامل را با یک ردیف پایگاه داده باطن ایجاد کنید تا به شما کمک کند چندین پایگاه داده را کاوش کنید. شما این برنامه را روی سرورهای وب واقعی، از جمله یک پلت فرم میزبانی ابری ساخته شده بر روی AWS EC2 با استفاده از Terraform و Docker Swarm، در حالی که ابزارهای دیگری مانند Redis و NGINX را ادغام خواهید کرد، مستقر خواهید کرد. همانطور که پیشرفت می کنید، در مورد واحد و تست عملکردی، همراه با استقرار زیرساخت تست با استفاده از Docker، یاد خواهید گرفت. در نهایت، خواهید فهمید که چگونه امنیت برنامه Node.js را سخت تر کنید، از Let's Encrypt برای ارائه سرویس HTTPS استفاده کنید و چندین اشکال امنیتی برنامه را با کمک روش های متخصص پیاده سازی کنید. با هر فصل، این کتاب به شما کمک می کند تا دانش خود را در طول چرخه عمر توسعه یک برنامه وب به کار ببرید.
در پایان این کتاب Node.js، Node عملی را به دست خواهید آورد. دانش توسعه وب js و قادر به ساخت و استقرار برنامه های خود در یک راه حل میزبانی وب عمومی.
اگر به دنبال جایگزینی برای "P" زبانها (Perl، PHP و Python)، یا اگر میخواهید با برنامهنویسی جاوا اسکریپت توسعه وب سمت سرور را شروع کنید، یا اگر میخواهید در استقرار خدمات در میزبانی ابری غوطهور شوید، این کتاب Node.js برای شما مناسب است. قبل از شروع کار با این کتاب، درک ابتدایی جاوا اسکریپت و توسعه برنامه های کاربردی وب ضروری است.
Build scalable web applications using Node.js, Express.js, and the latest ECMAScript techniques, along with deploying applications with AWS and Docker with this updated fifth edition
Node.js is the leading choice of server-side web development platform, enabling developers to use the same tools and paradigms for both server-side and client-side software. This updated fifth edition of Node.js Web Development focuses on the new features of Node.js 14, Express 4.x, and ECMAScript, taking you through modern concepts, techniques, and best practices for using Node.js.
The book starts by helping you get to grips with the concepts of building server-side web apps with Node.js. You'll learn how to develop a complete Node.js web app, with a backend database tier to help you explore several databases. You'll deploy the app to real web servers, including a cloud hosting platform built on AWS EC2 using Terraform and Docker Swarm, while integrating other tools such as Redis and NGINX. As you advance, you'll learn about unit and functional testing, along with deploying test infrastructure using Docker. Finally, you'll discover how to harden Node.js app security, use Let's Encrypt to provision the HTTPS service, and implement several forms of app security with the help of expert practices. With each chapter, the book will help you put your knowledge into practice throughout the entire life cycle of developing a web app.
By the end of this Node.js book, you'll have gained practical Node.js web development knowledge and be able to build and deploy your own apps on a public web hosting solution.
If you're looking for an alternative to the 'P' languages (Perl, PHP, and Python), or if you want to get started with server-side web development with JavaScript programming, or if you want a deep dive into deploying services to cloud hosting, this Node.js book is for you. A rudimentary understanding of JavaScript and web application development is a must before you get started with this book.
Title Page Copyright and Credits Dedication About Packt Contributors Table of Contents Preface Section 1: Introduction to Node.js Chapter 1: About Node.js Overview of Node.js The capabilities of Node.js What are folks doing with Node.js? Server-side JavaScript Why should you use Node.js? Popularity JavaScript everywhere Leveraging Google's investment in V8 Leaner, asynchronous, event-driven model Microservice architecture Node.js is stronger after a major schism and hostile fork The Node.js event-driven architecture The Node.js answer to complexity Asynchronous requests in Node.js Performance and utilization Is Node.js a cancerous scalability disaster? Server utilization, overhead costs, and environmental impact Embracing advances in the JavaScript language Deploying ES2015/2016/2017/2018 JavaScript code TypeScript and Node.js Developing microservices or maxiservices with Node.js Summary Chapter 2: Setting Up Node.js System requirements Installing Node.js using package managers Installing Node.js on macOS with MacPorts Installing Node.js on macOS with Homebrew Installing Node.js on Linux, *BSD, or Windows from package management systems Installing Node.js in WSL Opening an administrator-privileged PowerShell on Windows Installing the Node.js distribution from nodejs.org Installing from the source on POSIX-like systems Installing prerequisites Installing developer tools on macOS Installing from the source for all POSIX-like systems Installing from the source on Windows Installing multiple Node.js instances with nvm Installing nvm on Windows Requirements for installing native code modules Choosing Node.js versions to use and the version policy Choosing editors and debuggers for Node.js Running and testing commands Using Node.js's command-line tools Running a simple script with Node.js Writing inline async arrow functions Converting to async functions and the Promise paradigm Launching a server with Node.js Using npm, the Node.js package manager Using npx to execute Node.js packaged binaries Advancing Node.js with ECMAScript 2015, 2016, 2017, and beyond Using Babel to use experimental JavaScript features Summary Chapter 3: Exploring Node.js Modules Defining a Node.js module Examining the traditional Node.js module format Examining the ES6/ES2015 module format Injected objects in ES6 modules Computing the missing __dirname variable in ES6 modules Using CommonJS and ES6 modules together Using ES6 modules from CommonJS using import() Hiding implementation details with encapsulation in CommonJS and ES6 modules Using JSON modules Supporting ES6 modules on older Node.js versions Finding and loading modules using require and import Understanding File modules The ES6 import statement takes a URL Understanding the Node.js core modules Using a directory as a module Comparing installed packages and modules Finding the installed package in the file system Handling multiple versions of the same installed package Searching for globally installed packages Reviewing module identifiers and pathnames Using deep import module specifiers Overriding a deep import module identifier Studying an example project directory structure Loading modules using require, import, and import() Using npm – the Node.js package management system The npm package format Accessing npm helpful documentation Initializing a Node.js package or project with npm init Finding npm packages The package.json fields that help finding packages Installing an npm package Installing a package by version number Installing packages from outside the npm repository Global package installs Avoiding global module installation Maintaining package dependencies with npm Automatically updating package.json dependencies Fixing bugs by updating package dependencies Explicitly specifying package dependency version numbers Packages that install commands Configuring the PATH variable to handle locally installed commands Configuring the PATH variable on Windows Avoiding modifications to the PATH variable Updating packages you've installed when they're outdated Automating tasks with scripts in package.json Declaring Node.js version compatibility Publishing an npm package The Yarn package management system Summary Chapter 4: HTTP Servers and Clients Sending and receiving events with EventEmitter JavaScript classes and class inheritance The EventEmitter class The EventEmitter theory Understanding 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 the Windows cmd.exe command line Walking through the default Express application Understanding Express middleware Contrasting middleware and request handlers Error handling Creating an Express application to compute Fibonacci numbers Computationally intensive code and the Node.js event loop Algorithmic refactoring Making HTTPClient requests Calling a REST backend service from an Express application Implementing a simple REST server with Express Refactoring the Fibonacci application to call the REST service Some RESTful modules and frameworks Summary Section 2: Developing the Express Application Chapter 5: Your First Express Application Exploring Promises and async functions in Express router functions Promises and error handling in Express router functions Integrating async functions with Express router functions Architecting an Express application in the MVC paradigm Creating the Notes application Rewriting the generated router module as an ES6 module Creating the Notes application wiring – app.mjs Implementing the Notes data storage model Data hiding in ES-2015 class definitions Implementing an in-memory Notes datastore 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 Chapter 6: Implementing the Mobile-First Paradigm Understanding the problem – the Notes app isn't mobile-friendly Learning the mobile-first paradigm theory Using Twitter Bootstrap on the Notes application Setting up Bootstrap Adding Bootstrap to the Notes application 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 Customizing a Bootstrap build Using third-party custom Bootstrap themes Summary Chapter 7: Data Storage and Retrieval Remembering that data storage requires asynchronous code Logging and capturing uncaught errors Request logging with morgan Debugging messages Capturing stdout and stderr Capturing uncaught exceptions and unhandled rejected Promises Storing notes in a filesystem Dynamically importing ES6 modules Running the Notes application with filesystem storage Storing notes with the LevelDB datastore Closing database connections when closing the process Storing notes in SQL with SQLite3 The SQLite3 database schema The SQLite3 model code Running Notes with SQLite3 Storing notes the ORM way with Sequelize Configuring Sequelize and connecting to a database Creating a Sequelize model for the Notes application Running the Notes application with Sequelize Storing notes in MongoDB A MongoDB model for the Notes application Running the Notes application with MongoDB Summary Chapter 8: Authenticating Users with a Microservice Creating a user information microservice Developing the user information model Creating a REST server for user information Creating a command-line tool to test and administer the user authentication server Creating a user in the user information database Reading user data from the user information service Updating user information in the user information service Deleting a user record from the user information service Checking the user's password in the user information service Providing login support for the Notes application Accessing the user authentication REST API Incorporating login and logout routing functions in the Notes application Login/logout changes to app.mjs Login/logout changes in routes/index.mjs Login/logout changes required in routes/notes.mjs Viewing template changes supporting login/logout Running the Notes application with user authentication Providing Twitter login support for the Notes application Registering an application with Twitter Storing authentication tokens Implementing TwitterStrategy Keeping secrets and passwords secure Adding password encryption to the user information service Implementing encrypted password support in the Notes application Running the Notes application stack Summary Chapter 9: Dynamic Client/Server Interaction with Socket.IO Introducing Socket.IO Initializing Socket.IO with Express Real-time updates on the Notes homepage Refactoring the NotesStore classes to emit events Real-time changes in the Notes home page Changing the home page and layout templates Adding a Socket.IO client to the Notes home page Running Notes with real-time home page updates A word on enabling debug tracing in Socket.IO code Real-time action while viewing notes Changing the note view template for real-time action Running Notes with pseudo-real-time updates while viewing a note Inter-user chat and commenting for Notes Data model for storing messages Adding support for messages to the Notes router Changing the note view template for messages Composing messages on the Note view page Showing any existing messages on the Note view page Deleting messages on the Notes view page Running Notes and passing messages Summary Section 3: Deployment Chapter 10: Deploying Node.js Applications to Linux Servers Notes application architecture and deployment considerations Traditional Linux deployment for Node.js services Installing Multipass Handling a failure to launch Multipass instances on Windows Provisioning a server for the user authentication service Testing the deployed user authentication service Script execution in PowerShell on Windows Provisioning a server for the Notes service Adjusting Twitter authentication to work on the server Setting up PM2 to manage Node.js processes Familiarizing ourselves with PM2 Scripting the PM2 setup on Multipass Integrating the PM2 setup as persistent background processes Summary Chapter 11: Deploying Node.js Microservices with Docker Setting up Docker on your laptop or computer Installing and starting Docker with Docker for Windows or macOS Familiarizing ourselves with Docker Setting up the user authentication service in Docker Launching a MySQL container in Docker The ephemeral nature of Docker containers Defining the Docker architecture for the authentication service Creating the MySQL container for the authentication service Security in the database container Dockerizing the authentication service Creating the authentication service Dockerfile 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 Managing multiple containers with Docker Compose Docker Compose file for the Notes stack Building and running the Notes application with Docker Compose Using Redis for scaling the Notes application stack Testing session management with multiple Notes service instances Storing Express/Passport session data in a Redis server Distributing Socket.IO messages using Redis Summary Chapter 12: Deploying a Docker Swarm to AWS EC2 with Terraform Signing up with AWS and configuring the AWS CLI Finding your way around the AWS account Setting up the AWS CLI using AWS authentication credentials Creating an IAM user account, groups, and roles Creating an EC2 key pair An overview of the AWS infrastructure to be deployed Using Terraform to create an AWS infrastructure Configuring an AWS VPC with Terraform Configuring the AWS gateway and subnet resources Deploying the infrastructure to AWS using Terraform Setting up a Docker Swarm cluster on AWS EC2 Deploying a single-node Docker Swarm on a single EC2 instance Adding an EC2 instance and configuring Docker Launching the EC2 instance on AWS Handling the AWS EC2 key-pair file Testing the initial Docker Swarm Setting up remote control access to a Docker Swarm hosted on EC2 Setting up ECR repositories for Notes Docker images Using environment variables for AWS CLI commands Defining a process to build Docker images and push them to the AWS ECR Creating a Docker stack file for deployment to Docker Swarm Creating a Docker stack file from the Notes Docker compose file Placing containers across the swarm Configuring secrets in Docker Swarm Persisting data in a Docker swarm Provisioning EC2 instances for a full Docker swarm Configuring EC2 instances and connecting to the swarm Implementing semi-automatic initialization of the Docker Swarm Preparing the Docker Swarm before deploying the Notes stack Deploying the Notes stack file to the swarm Preparing to deploy the Notes stack to the swarm Deploying the Notes stack to the swarm Verifying the correct launch of the Notes application stack Diagnosing a failure to launch the database services Testing the deployed Notes application Logging in with a regular account on Notes Diagnosing an inability to log in with Twitter credentials Scaling the Notes instances Summary Chapter 13: 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 Creating the initial Notes model test case Running the first test case Adding some tests More tests for the Notes model Diagnosing test failures Testing against databases that require server setup – MySQL and MongoDB Using Docker Swarm to manage test infrastructure Using Docker Swarm to deploy test infrastructure Executing tests under Docker Swarm 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 a Puppeteer-based testing project directory Creating an initial Puppeteer test for the Notes application stack Executing the initial Puppeteer test Testing login/logout functionality in Notes Testing the ability to add Notes Implementing negative tests with Puppeteer Testing login with a bad user ID Testing a response to a bad URL Improving testability in the Notes UI Summary Chapter 14: Security in Node.js Applications Implementing HTTPS in Docker for deployed Node.js applications Assigning a domain name for an application deployed on AWS EC2 Updating the Twitter application Planning how to use Let's Encrypt Using NGINX and Let's Encrypt in Docker to implement HTTPS for Notes Adding the Cronginx container to support HTTPS on Notes Creating an NGINX configuration to support registering domains with Let's Encrypt Adding the required directories on the EC2 host Deploying the EC2 cluster and Docker swarm Registering a domain with Let's Encrypt Implementing an NGINX HTTPS configuration using Let's Encrypt certificates Testing HTTPS support for the Notes application Using Helmet for across-the-board security in Express applications Using Helmet to set the Content-Security-Policy header Making the ContentSecurityPolicy configurable Using Helmet to set the X-DNS-Prefetch-Control header Using Helmet to control enabled browser features using the Feature-Policy 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 Scanning for known vulnerabilities in Node.js packages Using good cookie practices Hardening the AWS EC2 deployment AWS EC2 security best practices Summary Other Books You May Enjoy Index