My Account Log in

2 options

Advanced Node.js development : master Node.js by building real-world applications / Andrew Mead.

EBSCOhost Academic eBook Collection (North America) Available online

View online

Ebook Central Academic Complete Available online

View online
Format:
Book
Author/Creator:
Mead, Andrew, author.
Language:
English
Subjects (All):
JavaScript (Computer program language).
Application software--Development.
Application software.
Physical Description:
1 online resource (584 pages) : illustrations
Edition:
1st ed.
Place of Publication:
Birmingham ; Mumbai : Packt Publishing, 2018.
Biography/History:
Mead Andrew: Andrew Mead - A Full-stack Developer & Teacher Andrew is a full-stack developer living in beautiful Philadelphia! He launched his first course in 2014 and had a blast teaching and helping others. Since then, he has launched 3 courses with over 110, 000 students and over 18, 000 5-star reviews. He currently teaches JavaScript, React, and Node. Before he ever thought about teaching, he created a web app development company. He has helped companies of all sizes launch production web applications to their customers. He had the honor of working with awesome companies like Siemens, Mixergy, and Parkloco. He had a Computer Science degree from Temple University, and I've been programming for just over a decade. I love creating, programming, launching, learning, teaching, and biking. He can't wait to see you inside one of my courses!
Summary:
Advanced Node.js Development takes your Node.js skills to the next level. The book is based on the latest release of Node (9.x) and covers advanced topics, such as building real-time web apps with Socket.IO, and reactive, asyncronous apps with Async and Await. You don't need to have read the first book in the series; any developer who knows.
Contents:
Cover
Title Page
Copyright and Credits
Packt Upsell
Contributors
Table of Contents
Preface
Chapter 1: Getting Set Up
Installing MongoDB and Robomongo for Linux and macOS
Installing MongoDB and Robomongo for Windows
Creating and reading data
Summary
Chapter 2: MongoDB, Mongoose, and REST APIs - Part 1
Connecting to MongoDB and writing data
Creating a directory for the project
Connecting the mongodb-connect file to the database
Adding a string as the first argument
Adding the callback function as the second argument
Error handling in mongodb-connect
Running the file in the Terminal
Adding data to the database
Adding a new record into a collection
The ObjectId
The _id property in the context of MongoDB
Calling the .getTimestamp function
Using object destructuring ES6
Creating a new instance of objectID
Fetching data
Fetching todos in Robomongo file
The find method
Writing a query to fetch certain values
Writing a query to fetch completed todos
Qureying todos by id
Implementing the count method
Querying users collection
Setting up the repo
Deleting documents
Exploring methods to delete data
The deleteMany method
The deleteOne Method
The deleteOne method
The findOneAndDelete method
Using the deleteMany and findOneAndDelete methods
Removing duplicate documents
Targeting the documents using ID
Running the findOneAndDelete and deleteMany statements
Making commit for the deleting documents methods
Updating data
Chapter 3: MongoDB, Mongoose, and REST APIs - Part 2
Setting up Mongoose
Setting up root of the project
Connecting mongoose to database
Creating the todo model
Creating a brand-new Todo
Saving the instance to the database
Running the Todos script.
Creating a second Todo model
Validators, Types, and Defaults
Mongoose validators
Customizing the Todo text property
Mongoose defaults
Mongoose types
Creating a Mongoose user model for authentication
Setting up the email property
Installing Postman
Making an HTTP request to Google
Illustrating working of the JSON data
Resource Creation Endpoint - POST /todos
Refactoring the server.js file to create POST todos route
Configuring the Todo and Users file
Loading Todo and User file in server.js
Configuring the Express application
Configuring the POST route
Getting body data from the client
Creating an instance of Mongoose model
Setting up HTTP status code
Testing POST /todos inside of Postman
Adding more Todos to the database
Testing POST /todos
Installing npm modules for testing POST /todos route
Setting up the test files
Loading the test files
Adding describe block for the test cases
Making the POST requests via supertest
Making assertions about the POST request
Making a request to fetch the Todos from the database
Adding the catch call for the error handling
Setting up test scripts in package.json
Adding testing life cycle method in server.test.js file
Running the test suite
Test case: should not create todo with invalid body data
Making assertions about the length of the Todos collection
Making commit for POST /todos route
List Resources - GET /todos
Creating the GET /todos route
Testing the GET /todos route
Setting up Post request to create a todo
Testing GET /todos
Adding seed data for the GET /todos test case
Adding a describe block to the test case
Adding assertions to the test case
Chapter 4: MongoDB, Mongoose, and REST APIs - Part 3
Mongoose queries and ID validation
Todo.find method.
Todo.findOne method
Todo.findById method
Handling situations where the ID doesn't exist
Validating an ObjectID
Getting an individual resource - GET /todos/:id
Taking on the challenge
Challenge step 1 - filling the code
Challenge step 2 - Making the query
challenge step 3 - success path
Testing GET /todos/:id
Writing test cases for GET/todos/:id
Test 1 - Super test request
Test 2 - Verifying invalid ID
Test 3 - Validating invalid ObjectID
Deploying the API to Heroku
Creating a Heroku app
Heroku logs
Postman environments
Managing Postman environments
Todo App Local environment
Todo App Heroku environment
Deleting a resource - DELETE /todos/:id
Todo.remove method
Todo.findOneAndRemove method
Todo.findByIdAndRemove method
Creating a delete route
Testing DELETE /todos/:id
Test case 1 - should remove a todo
Test case 2 - should return 404 if todo not found
Test case 3 - should return 404 if object id is invalid
Test case 4 - should return 404 if todo not found
Updating a Resource - PATCH /todos/:id
Installing Lodash library
Testing Todos for the patch call
Testing PATCH /todos/:id
Test 1 - To complete the incomplete todo
Test 2 - to make complete todo incomplete
Creating a Test database
Chapter 5: Real-Time Web Apps with Socket.io
Creating a new web app project
Setting up our basic app structure
Setting up the index.html file for DOCTYPE
Setting up the server.js file for the public directory
The join method
Configuring basic server setup
Setting up a gitignore file
Making a commit with the current uncommitted files
Adding Socket.io to an app
Setting up Socket.io
Creating a server using the http library
Configuring the server to use Socket.io
Communication between the client and server.
The io.on method
Adding a connection event in the client
The disconnect event
Emitting and listening to custom events
Creating custom events inside an application
Moving the JavaScript into a separate file
Adding a newEmail custom event
The emit method
Testing the newEmail event
Adding a createEmail custom event
socket.emit in the developer console
The custom events in the chat app
The newMessage event
Broadcasting events
Wiring up the createMessage listener for all users
Testing the messaging events
Committing and deploying messaging to Heroku
Testing messaging in a Firefox browser using Heroku
Broadcasting events to other users
Emitting two events when a user connects
Greeting an individual user
Broadcasting a new user in the chat
Testing the user connection
Chapter 6: Generating newMessage and newLocationMessage
Message generator and tests
Generating the newMessage object using the utility function
Writing test cases
Adding the test-watch script
Adding the test script
Running the test suite for the message utility
Integrate the utility function into our application
Event acknowledgements
Setting up acknowledgements
Sending an acknowledgement from server to the client
Updating the event emitter
Updating the event listener
The message form and jQuery
Using the jQuery library
Adding the form field in index.html
Setting up the form tag
Adding the text field
Testing the form's rendering
Using jQuery to select element
Adding the selector element to index.js
Testing the update event listener
Rendering incoming messages to the screen
Creating an ordered list to render messages
Using jQuery to create element in index.js
Testing the incoming messages
Making a commit for the message form
Geolocation.
Adding the Send Location button to the application
Adding a click listener to the Send Location button
Checking access to the geolocation API
Fetching a user's position
Adding the coordinates object in the users position
Passing coordinates data with the connected users
Rendering clickable link in place of text coordinates
Sorting out the URL structure
Emitting newLoactionMessage
Adding generateLocationMessage in the message.js file
Adding an event listener for newLocationMessage
Adding test case for generateLocationMessage
Adding variables for the test case
Making assertion for generateLocationMessage
Running the test case for generateLocationMessage
Chapter 7: Styling Our Chat Page as a Web App
Styling the chat page
Storing the template styles
Tweaking the structure for alignment
Making user experience improvements
Changing the form submit listener
Updating the input tag
Customizing the Send Location
Updating the button text
Timestamps and formatting with Moment
Timestamps in Node
The Date object
Using Moment for timestamps
The Moment documentation
Formatting date using Moment
The Manipulate section in Moment
Printing message timestamps
Getting the formatted values back from timestamps
Updating the message.js file
Integrating Moment on client
Updating the newMessage property
Updating the newLocationMessage property
Mustache.js
Adding mustache.js to the directory
Creating and rendering template for newMessage
Implementing the Mustache.js rendering method
Getting all the data showing up
Providing a custom structure
Adding the list item tag
Adding the message body tag
Creating template for the newLocation message
Rendering the newLocation template
Autoscrolling.
Running a height properties calculation.
Notes:
Description based on print version record.
ISBN:
9781788394796
1788394798
OCLC:
1463579293

The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.

Find

Home Release notes

My Account

Shelf Request an item Bookmarks Fines and fees Settings

Guides

Using the Find catalog Using Articles+ Using your account