Mastering Node. js Web Development Go on a Comprehensive Journey from the Fundamentals to Advanced Web Development with Node. js
Dive into the world of Node.js with this comprehensive guide, taking you from foundational concepts to practical web development mastery. Written by an industry veteran with over 50 programming books under his belt, this book will help both beginners and seasoned developers. Gain a deep understandin...
Otros Autores: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Birmingham, England :
Packt Publishing
[2024]
|
Edición: | First edition |
Colección: | Expert insight.
|
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009835411006719 |
Tabla de Contenidos:
- Cover
- Copyright Page
- Contributors
- Table of Contents
- Part I - Putting Node.js in Context
- Chapter 1: Getting Ready
- What do you need to know?
- How do you set up your development environment?
- Are there lots of examples?
- Where can you get the example code?
- What if you have problems following the examples?
- What if you find an error in the book?
- How do you contact the author?
- What if you really enjoyed this book?
- What if this book has made you angry?
- Chapter 2: Working with the Node.js Tools
- Getting ready
- Installing Git
- Selecting a code editor
- Using Node.js
- Understanding the npm tool
- Initializing a project
- Managing packages
- Installing development packages
- Listing packages
- Checking for package security vulnerabilities
- Executing packages
- Using the npx command
- Using script commands
- Defining custom commands
- Summary
- Chapter 3: JavaScript and TypeScript Primer
- Preparing for this chapter
- Understanding JavaScript confusion
- Using the JavaScript features to express type expectations
- Using JavaScript to check type expectations
- Using a type union
- Understanding the basic TypeScript/JavaScript features
- Defining variables and constants
- Dealing with unassigned and null values
- Using the JavaScript primitive types
- Working with booleans
- Working with strings
- Using template strings
- Working with numbers
- Working with null and undefined values
- Using the JavaScript operators
- Using conditional statements
- The equality operator vs. the identity operator
- Using the null and nullish coalescing operators
- Using the optional chaining operator
- Defining and using functions
- Defining optional function parameters
- Defining default parameter values
- Defining rest parameters
- Defining functions that return results.
- Using functions as arguments to other functions
- Defining functions using the arrow syntax
- Understanding value closure
- Working with arrays
- Reading and modifying the contents of an array
- Enumerating the contents of an array
- Using the spread operator
- Working with objects
- Understanding literal object types
- Defining optional properties in a type annotation
- Defining classes
- Adding methods to a class
- Access controls and simplified constructors
- Using class inheritance
- Checking object types
- Working with JavaScript modules
- Creating and using modules
- Consolidating module contents
- Summary
- Chapter 4: Understanding Node.js Concurrency
- Preparing for this chapter
- Creating a simple web application
- Understanding (simplified) server code execution
- Understanding multi-threaded execution
- Understanding blocking and non-blocking operations
- Understanding JavaScript code execution
- Understanding Node.js code execution
- Using the Node.js API
- Handling events
- Working with promises
- Wrapping callbacks and unwrapping promises
- Executing custom code
- Yielding control of the main thread
- Using worker threads
- Writing the worker code
- Creating a worker thread
- Packaging worker threads into a callback
- Packaging worker threads into a promise
- Summary
- Chapter 5: Handling HTTP Requests
- Preparing for this chapter
- Listening for HTTP requests
- Understanding the Server configuration object
- Understanding HTTP requests
- Parsing URLs
- Understanding HTTP responses
- Supporting HTTPS requests
- Creating the self-signed certificate
- Handling HTTPS requests
- Detecting HTTPS requests
- Redirecting insecure requests
- Using third-party enhancements
- Using the Express router
- Using the request and response enhancements
- Using Express route parameters
- Summary.
- Chapter 6: Using Node.js Streams
- Preparing for this chapter
- Understanding streams
- Using Node.js streams
- Writing data to a stream
- Understanding stream enhancements
- Avoiding excessive data buffering
- Reading data from a stream
- Understanding the Readable class
- Reading data with events
- Reading data with an iterator
- Piping data to a writable stream
- Transforming data
- Using object mode
- Using third-party enhancements
- Working with files
- Serving files from client-side packages
- Sending and downloading files
- Automatically decoding and encoding JSON
- Summary
- Chapter 7: Using Bundles and Content Security
- Preparing for this chapter
- Packaging client files
- Creating stand-alone bundles
- Using the webpack development server
- Using a different request URL
- Forwarding requests from webpack to the backend server
- Forwarding requests from the backend server to webpack
- Using a content security policy
- Injecting malicious content
- Defining a content security policy
- Using a package to set the policy header
- Summary
- Chapter 8: Unit Testing and Debugging
- Preparing for this chapter
- Unit testing Node.js applications
- Writing unit tests
- Arranging a test
- Performing a test
- Asserting test results
- Testing asynchronous code
- Testing promises
- Creating subtests
- Debugging javascript code
- Adding code breakpoints
- Using Visual Studio Code for debugging
- Using the remote Node.js debugger
- Summary
- Part II - Node.js in Detail
- Chapter 9: Creating the Example Project
- Understanding the project
- Creating the project
- Installing the application packages
- Installing the development tool packages
- Installing the type packages
- Creating the configuration files
- Creating the backend server
- Creating the HTML and client-side JavaScript code.
- Running the example application
- Summary
- Chapter 10: Using HTML Templates
- Preparing for this chapter
- Using server-side HTML templates
- Creating a simple template engine
- Creating the custom template engine
- Setting up the custom template engine
- Evaluating expressions in templates
- Adding template features
- Mapping expressions to features
- Using templates to create a simple round-trip application
- Using client-side HTML templates
- Using a template package
- Using a package for server-side templates
- Defining the templates
- Using a package for client-side templates
- Summary
- Chapter 11: Handling Form Data
- Preparing for this chapter
- Receiving form data
- Receiving form data from GET requests
- Receiving form data from POST requests
- Receiving multipart data
- Sanitizing form data
- Validating form data
- Creating a custom validator
- Applying validation rules
- Validating data
- Performing client-side validation
- Using a package for validation
- Summary
- Chapter 12: Using Databases
- Preparing for this chapter
- Using a database
- Installing the database package
- Creating a repository layer
- Implementing the repository
- Querying the database
- Displaying data
- Understanding SQL query parameters
- Writing to the database
- Using an ORM package
- Defining the database using JavaScript objects
- Creating the model classes
- Initializing the data model
- Configuring the model relationships
- Defining the seed data
- Converting data models to flat objects
- Implementing the repository
- Querying for data
- Writing data
- Applying the repository
- Summary
- Chapter 13: Using Sessions
- Preparing for this chapter
- Correlating stateless HTTP requests
- Using cookies to correlate requests
- Receiving cookies
- Setting and reading cookies
- Signing cookies.
- Using a package to manage cookies
- Using sessions
- Creating the session middleware
- Using the session feature
- Storing session data in a database
- Using a package for sessions
- Summary
- Chapter 14: Creating RESTful Web Services
- Preparing for this chapter
- Preparing for a web service
- Understanding web services
- Creating a basic RESTful web service
- Getting data for the web service
- Separating the HTTP code
- Updating data
- Replacing data with PUT requests
- Modifying data with PATCH requests
- Using JSON Patch
- Validating client data
- Creating the validation infrastructure
- Defining validation for the Result API
- Performing model validation
- Using a package for web services
- Creating an adaptor for web services
- Summary
- Chapter 15: Authenticating and Authorizing Requests
- Preparing for this chapter
- Understanding the end-to-end process
- Authenticating users
- Creating a credential store
- Creating the authentication workflow
- Authenticating requests
- Using the authentication data
- Authenticating web service requests
- Creating the authentication API
- Authenticating the web service client
- Authorizing requests
- Adding support for roles
- Checking authorization
- Authorizing API requests
- Using packages for authentication and authorization
- Authenticating HTML clients
- Summary
- Part III - SportsStore
- Chapter 16: SportsStore: A Real Application
- Understanding the project structure
- Creating the project
- Setting up the development tools
- Handling HTTP requests
- Creating a configuration system
- Adding application routes
- Adding support for HTML templates
- Creating layouts and templates
- Creating error handlers
- Starting the data model
- Implementing the repository
- Creating the repository class
- Defining the configuration settings.
- Defining the seed data.