Index
A
- addUser test case
- adding / Adding the test case for addUser
- instances, adding in users.test file / Adding new instances in the users.test file
- assertions, creating for users call / Making the assertions for the users call
- executing / Running the addUser test case
- assertion
- creating, for generateLocationMessage / Making assertion for generateLocationMessage
- async/await
- using, in promises / Using async/await features in promises
- getUser project, setting up / Setting up the getUser project
- getGrades project, setting up / Setting up the getGrades project
- getStatus project, setting up / Setting up the getStatus project
- basics / Async/await basics
- async function, using / Using the async function
- await function, using / Using the await function
- real-world example / A real-world example
- async function
- using / Using the async function
- error, rejecting / Rejecting an error using the async function
- awaiting / Handling errors and awaiting async function
- getExchangeRate, converting / Converting getExchangeRate and getCountries into the async function
- getCountries, converting / Converting getExchangeRate and getCountries into the async function
- error handling / Error handling in the async function
- autoscrolling
- adding / Autoscrolling
- await function
- using / Using the await function
B
- basic app structure
- setting up / Setting up our basic app structure
- basic server setup
- configuring / Configuring basic server setup
- brand-new Todo
- creating / Creating a brand-new Todo
- Broadcasting events
- about / Broadcasting events
- createMessage listener, wiring up for users / Wiring up the createMessage listener for all users
- to other users / Broadcasting events to other users
- button text
- updating / Updating the button text
C
- calculation
- new variable, creating to scroll messages to bottom / Creating a new variable to scroll messages to the bottom
- calculation-related changes
- committing / Committing the calculation-related changes
- calculations
- testing / Testing the calculations
- catch call
- adding, for error handling / Adding the catch call for the error handling
- challenges, GET /todos/id
- code, filling / Challenge step 1 - filling the code
- chat app
- new features, adding / New feature ideas
- chat page, styling
- about / Styling the chat page
- template styles, storing / Storing the template styles
- clickable link
- rendering, in text coordinates / Rendering clickable link in place of text coordinates
- click listener
- adding, to Send Location button / Adding a click listener to the Send Location button
- commit
- making, for deleting documents methods / Making commit for the deleting documents methods
- creating, for message form / Making a commit for the message form
- connection event
- adding, in client / Adding a connection event in the client
- coordinates data
- passing, with connected users / Passing coordinates data with the connected users
- coordinates object
- adding, to users position / Adding the coordinates object in the users position
- createEmail custom event
- adding / Adding a createEmail custom event
- currency-converter
- creating, with async/await function / Creating a currency-converter using the async/await function
- APIs, exploring for currency exchange rate / Exploring APIs for currency exchange rate
- axios, using / Taking advantage of axios inside our application
- getExchangeRate function / The getExchangeRate function
- getCountries function / The getCountries function
- convertCurrencyAlt, creating as async/await function / Creating convertCurrencyAlt as the async/await function
- custom events
- emitting / Emitting and listening to custom events
- listening / Emitting and listening to custom events
- creating, in application / Creating custom events inside an application
- in chat app / The custom events in the chat app
- custom structure
- providing / Providing a custom structure
D
- data
- writing / Connecting to MongoDB and writing data
- fetching / Fetching data
- updating / Updating data
- passing / Passing room data
- obtaining, to server / Getting data to the server
- data, deleting
- deleteMany method / The deleteMany method
- deleteOne method / The deleteOne Method, The deleteOne method
- findOneAndDelete method / The findOneAndDelete method
- deleteMany method, using / Using the deleteMany and findOneAndDelete methods
- findOneAndDelete method, using / Using the deleteMany and findOneAndDelete methods
- duplicate documents, removing / Removing duplicate documents
- document, targeting with ID / Targeting the documents using ID
- findOneAndDelete statement, running / Running the findOneAndDelete and deleteMany statements
- deleteMany statement, running / Running the findOneAndDelete and deleteMany statements
- data, fetching
- find method / The find method
- count method, implementing / Implementing the count method
- users collection, querying / Querying users collection
- database
- instance, saving / Saving the instance to the database
- data body
- obtaining, from client / Getting body data from the client
- data showing up process
- getting / Getting all the data showing up
- date
- formatting, with Moment / Formatting date using Moment
- Date object / The Date object
- DELETE /todos/id
- resource, deleting / Deleting a resource – DELETE /todos/:id
- Todo.remove method / Todo.remove method
- Todo.findOneAndRemove method / Todo.findOneAndRemove method
- Todo.findByIdAndRemove method / Todo.findByIdAndRemove method
- delete route, creating / Creating a delete route
- testing / Testing DELETE /todos/:id
- todo, removing / Test case 1 - should remove a todo
- 404 return, if todo not found / Test case 2 - should return 404 if todo not found
- return 404, if object id invalid / Test case 3 - should return 404 if object id is invalid
- return 404, if todo not found / Test case 4 - should return 404 if todo not found
- deparams / The params and deparams
- describe block
- adding, for test cases / Adding describe block for the test cases
- adding, to test case / Adding a describe block to the test case
- directory
- mustache.js, adding to / Adding mustache.js to the directory
- documents
- deleting / Deleting documents
E
- email property
- setting up / Setting up the email property
- emit method / The emit method
- error handling
- adding, in chat.js / Adding error handler case in chat.js
- about / Handling errors and awaiting async function
- in async function / Error handling in the async function
- error, printing to screen / Printing an error to the screen
- for getExchangeRate function / Error handling for the getExchangeRate function
- ES6 class
- users, storing with / Storing users with ES6 classes – Part I
- syntax / The ES6 class syntax
- creating, for person / Creating the ES6 class for a person
- constructor function / The constructor function
- method function / The method function
- event acknowledgements
- using / Event acknowledgements
- about / Event acknowledgements
- setting up / Setting up acknowledgements
- sending, from server to client / Sending an acknowledgement from server to the client
- event listener
- updating / Updating the event listener
- adding, for newLocationMessage / Adding an event listener for newLocationMessage
- events
- emitting, while user connects / Emitting two events when a user connects
- Express application
- configuring / Configuring the Express application
F
- find method
- about / The find method
- query, writing to fetch certain values / Writing a query to fetch certain values
- query, writing to completed todos / Writing a query to fetch completed todos
- todos, qureying by id / Qureying todos by id
- form's rendering
- testing / Testing the form's rendering
- form-fields
- adding, for chat page / Adding the form-fields for the chat page
- formatted values
- getting, from timestamps / Getting the formatted values back from timestamps
- form field
- adding, to index.html / Adding the form field in index.html
- form submit listener
- changing / Changing the form submit listener
- form tag
- setting up / Setting up the form tag
- function
- creating, to generate newMessage object / Message generator and tests
G
- generateLocationMessage
- adding, in message.js file / Adding generateLocationMessage in the message.js file
- test case, adding / Adding test case for generateLocationMessage
- assertion, creating / Making assertion for generateLocationMessage
- test case, executing / Running the test case for generateLocationMessage
- geolocation API
- using / Geolocation
- Send Location button, adding / Adding the Send Location button to the application
- access, checking / Checking access to the geolocation API
- user's position, fetching / Fetching a user's position
- GET /todos
- testing / Testing GET /todos
- seed data, adding / Adding seed data for the GET /todos test case
- GET /todos/id
- resource, obtaining / Getting an individual resource – GET /todos/:id
- testing / Testing GET /todos/:id
- test cases, writing / Writing test cases for GET/todos/:id
- super test request / Test 1 - Super test request
- invalid ID, verifying / Test 2 - Verifying invalid ID
- invalid ObjectID, validating / Test 3 - Validating invalid ObjectID
- getExchangeRate function
- error handling / Error handling for the getExchangeRate function
- getGrades project
- setting up / Setting up the getGrades project
- grades, creating / Creating grades for the getGrades project
- promise, returning / Returning a new promise
- getStatus project
- setting up / Setting up the getStatus project
- getStatus string, resolving / Resolving the getStatus string
- average, calculating / Calculating the average
- template string, returning / Returning the template string
- getUser project
- setting up / Setting up the getUser project
- array find method / The array find method
- getUser object test, executing / Running the getUser object test
- gitignore file
- setting up / Setting up a gitignore file
H
- height properties calculation
- executing / Running a height properties calculation
- calculation, determining / Determining the calculation
- message height, considering / Taking into account the height of new message
- Heroku
- Todo API, deploying / Deploying the API to Heroku
- application, creating / Creating a Heroku app
- heroku logs / Heroku logs
- HTML file
- updating / Updating the HTML file
- head tag, adding / Adding the head tag in the HTML file
- body tag, adding / Adding the body tag in the HTML file
- HTTP request
- creating, to Google / Making an HTTP request to Google
- HTTP Status Codes
- setting up / Setting up HTTP status code
- reference / Setting up HTTP status code
I
- incoming messages
- rendering, to screen / Rendering incoming messages to the screen
- testing / Testing the incoming messages
- index.html
- form field, adding / Adding the form field in index.html
- changes, committing / Committing the changes in index.html
- index.html file
- setting up, for DOCTYPE / Setting up the index.html file for DOCTYPE
- setting up, for public directory / Setting up the server.js file for the public directory
- index.js
- selector element, adding / Adding the selector element to index.js
- element, creating with jQuery / Using jQuery to create element in index.js
- individual resource
- challenge / Taking on the challenge
- query, creating / Challenge step 2 - Making the query
- path / challenge step 3 - success path
- input tag
- updating / Updating the input tag
- io.on method / The io.on method
- isRealString function
- defining / Defining the isRealString function
- calling, in server.js / Calling the isRealString function in server.js
J
- JavaScript
- moving, into separate file / Moving the JavaScript into a separate file
- join method / The join method
- join page
- adding / Adding a join page
- jQuery
- about / The message form and jQuery
- using, to select element / Using jQuery to select element
- used, for creating element in index.js / Using jQuery to create element in index.js
- jQuery library
- using / Using the jQuery library
- JSON data
- working, illustrating / Illustrating working of the JSON data
L
- length of Todos collection
- assertions, creating / Making assertions about the length of the Todos collection
- Linux
- MongoDB, installing / Installing MongoDB and Robomongo for Linux and macOS
- Robomongo, installing / Installing MongoDB and Robomongo for Linux and macOS
- listener
- setting up, in server.js / Setting up listener in server.js
- list item tag
- adding / Adding the list item tag
- list resources
- about / List Resources - GET /todos
- GET /todos route, creating / Creating the GET /todos route
- GET /todos route, testing / Testing the GET /todos route
M
- macOS
- MongoDB, installing / Installing MongoDB and Robomongo for Linux and macOS
- Robomongo, installing / Installing MongoDB and Robomongo for Linux and macOS
- Manipulate section
- in Moment / The Manipulate section in Moment
- message
- formatting, with Moment / Timestamps and formatting with Moment
- message.js file
- generateLocationMessage, adding / Adding generateLocationMessage in the message.js file
- updating / Updating the message.js file
- message body tag
- adding / Adding the message body tag
- message form
- about / The message form and jQuery
- commit, creating / Making a commit for the message form
- messages
- sending, to room only / Sending messages to room only
- chat.js file, updating / Updating the chat.js and server.js files
- server.js file, updating / Updating the chat.js and server.js files
- event, emitting to individual room / Emitting event to the individual room
- createLoactionMessage, fixing for individual room / Wiring up createLoactionMessage for individual room
- individual room changes, committing / Committing the individual room changes
- message timestamps
- printing / Printing message timestamps
- messaging
- committing, to Heroku / Committing and deploying messaging to Heroku
- deploying, to Heroku / Committing and deploying messaging to Heroku
- testing, in Firefox browser Heroku used / Testing messaging in a Firefox browser using Heroku
- messaging events
- testing / Testing the messaging events
- methods
- exploring, to delete data / Exploring methods to delete data
- Moment
- message, formatting / Timestamps and formatting with Moment
- used, for timestamps / Using Moment for timestamps
- about / Using Moment for timestamps
- used, for date formatting / Formatting date using Moment
- integrating, on client / Integrating Moment on client
- Moment documentation / The Moment documentation
- MongoDB
- installing, for Linux / Installing MongoDB and Robomongo for Linux and macOS
- installing, for macOS / Installing MongoDB and Robomongo for Linux and macOS
- reference / Installing MongoDB and Robomongo for Linux and macOS
- installing, for Windows / Installing MongoDB and Robomongo for Windows
- connecting / Connecting to MongoDB and writing data
- directory, creating for project / Creating a directory for the project
- mongodb-connect file, connecting to database / Connecting the mongodb-connect file to the database
- data, adding to database / Adding data to the database
- record, adding into collection / Adding a new record into a collection
- _id property / The _id property in the context of MongoDB
- ObjectId / Using object destructuring ES6
- data, fetching / Fetching data
- repo, setting up / Setting up the repo
- documents, deleting / Deleting documents
- data, updating / Updating data
- mongodb-connect file, connecting to database
- string, adding as first argument / Adding a string as the first argument
- callback function, adding as second argument /
- error handling / Error handling in mongodb-connect
- file, executing in Terminal / Running the file in the Terminal
- Mongoose
- setting up / Setting up Mongoose, Connecting mongoose to database
- reference / Setting up Mongoose
- project, setting up / Setting up root of the project
- connecting, to database / Connecting mongoose to database
- todomodel, creating / Creating the todo model
- queries, validation / Mongoose queries and ID validation
- ID validation / Mongoose queries and ID validation
- Todo.find method / Todo.find method
- Todo.findOne method / Todo.findOne method
- Todo.findById method / Todo.findById method
- situations, handling / Handling situations where the ID doesn't exist
- ObjectID, validating / Validating an ObjectID
- Mongoose defaults / Validators, Types, and Defaults, Mongoose defaults, Mongoose types
- Mongoose model
- instance, creating / Creating an instance of Mongoose model
- Mongoose types / Validators, Types, and Defaults
- Mongoose user model
- creating, for authentication / Creating a Mongoose user model for authentication
- Mongoose validators / Validators, Types, and Defaults, Mongoose validators
- mustache.js
- about / Mustache.js
- adding, to directory / Adding mustache.js to the directory
- rendering method, implementing / Implementing the Mustache.js rendering method
N
- newEmail custom event
- adding / Adding a newEmail custom event
- newEmail event
- testing / Testing the newEmail event
- newLocationMessage
- emitting / Emitting newLoactionMessage
- event listener, adding / Adding an event listener for newLocationMessage
- template, creating / Creating template for the newLocation message
- template, rendering / Rendering the newLocation template
- newLocationMessage property
- updating / Updating the newLocationMessage property
- newMessage
- template, creating / Creating and rendering template for newMessage
- template, rendering / Creating and rendering template for newMessage
- newMessage event / The newMessage event
- newMessage object
- generating, with utility function / Generating the newMessage object using the utility function
- newMessage property
- updating / Updating the newMessage property
- node-mongodb-native / Connecting to MongoDB and writing data
- npm modules
- installing, for testing POST/todos route / Installing npm modules for testing POST /todos route
O
- ObjectId
- about / The ObjectId, Using object destructuring ES6
- new instance, creating / Creating a new instance of objectID
- ordered list
- creating, to render messages / Creating an ordered list to render messages
P
- params / The params and deparams
- PATCH /todos/id
- resource, updating / Updating a Resource - PATCH /todos/:id
- Lodash library, installing / Installing Lodash library
- testing, for patch call / Testing Todos for the patch call
- Todos, testing for patch call / Testing Todos for the patch call
- testing / Testing PATCH /todos/:id
- incomplete todo, completing / Test 1 - To complete the incomplete todo
- to make complete todo incomplete / Test 2 - to make complete todo incomplete
- People list
- adding, in chat room / Adding People list in the chat room
- DOM, updating with jQuery / Adding jQuery to update the DOM
- user, adding to users list / Adding user to the user's list
- users, adding with unique ID / Adding users with unique ID
- event, emitting to clients / Emitting the event to the clients
- users list, testing in chatroom / Testing the users list in the chatroom
- POST /todos
- testing, in Postman / Testing POST /todos inside of Postman
- testing / Testing POST /todos
- route commit, creating / Making commit for POST /todos route
- Postman
- about / Setting up the email property
- installing / Installing Postman, Making an HTTP request to Google
- reference / Installing Postman
- Postman environments
- about / Postman environments
- managing / Managing Postman environments
- Todo App Local environment / Todo App Local environment
- Todo App Heroku environment / Todo App Heroku environment
- POST request
- creating, via supertest / Making the POST requests via supertest
- assertions, creating / Making assertions about the POST request
- setting up, to create todo / Setting up Post request to create a todo
- POST route
- configuring / Configuring the POST route
- promises
- async/await, using / Using async/await features in promises
R
- real-world example
- for async/await / A real-world example
- currency-converter, creating / Creating a currency-converter using the async/await function
- repository
- setting up / Setting up the repo
- Resource Creation Endpoint
- about / Resource Creation Endpoint - POST /todos
- server.js file, refactoring to create POST todos route / Refactoring the server.js file to create POST todos route
- Robomongo
- installing, for Linux / Installing MongoDB and Robomongo for Linux and macOS
- installing, for macOS / Installing MongoDB and Robomongo for Linux and macOS
- reference / Installing MongoDB and Robomongo for Linux and macOS
- installing, for Windows / Installing MongoDB and Robomongo for Windows
- installing, for windows / Installing MongoDB and Robomongo for Windows
- Robomongo file
- todos, fetching / Fetching todos in Robomongo file
S
- selector element
- adding, to index.js / Adding the selector element to index.js
- Send Location
- customizing / Customizing the Send Location
- Send Location button
- adding, to geolocation API / Adding the Send Location button to the application
- click listener, adding / Adding a click listener to the Send Location button
- server.js file
- refactoring, to create POST todos route / Refactoring the server.js file to create POST todos route
- setting up, for public directory / Setting up the server.js file for the public directory
- socket.emit
- in developer console / socket.emit in the developer console
- Socket.io
- adding, to an app / Adding Socket.io to an app
- setting up / Setting up Socket.io
- server, creating http library used / Creating a server using the http library
- used, for configuring server / Configuring the server to use Socket.io
- client and server, communication / Communication between the client and server
- disconnect event / The disconnect event
- about / Socket.io rooms
- specific user, targeting / Targeting the specific user
- specific user, set up testing / Testing the specific user set up
- structure
- tweaking, for alignment / Tweaking the structure for alignment
T
- template
- creating, for newMessage / Creating and rendering template for newMessage
- rendering, for newMessage / Creating and rendering template for newMessage
- creating, for newLocation message / Creating template for the newLocation message
- test cases
- about / Test case: should not create todo with invalid body data
- writing / Writing test cases
- test-watch script, adding / Adding the test-watch script
- test script, adding / Adding the test script
- test suite, executing for message utility / Running the test suite for the message utility
- adding, for generateLocationMessage / Adding test case for generateLocationMessage
- variables, adding / Adding variables for the test case
- executing, for generateLocationMessage / Running the test case for generateLocationMessage
- adding, for validation function / Adding test cases for the new validation function
- adding, in chat.js / Adding test cases for the new validation function, Test case 1 – should reject non-string values, Test case 2 – should reject string with only spaces, Test case 3 – should allow strings with non-space characters
- Test database
- creating / Creating a Test database
- test files
- setting up / Setting up the test files
- loading / Loading the test files
- testing life cycle method
- adding, in server.test.js file / Adding testing life cycle method in server.test.js file
- test scripts
- setting up, in package.json / Setting up test scripts in package.json
- test suite
- executing / Running the test suite
- setting up / Message generator and tests
- text field
- adding / Adding the text field
- timestamps
- about / Timestamps and formatting with Moment
- in Node / Timestamps in Node
- Moment, using / Using Moment for timestamps
- Todo API
- deploying, to Heroku / Deploying the API to Heroku
- deploying, on Heroku / Deploying the API to Heroku
- Todo file
- configuring / Configuring the Todo and Users file
- loading, in server.js / Loading Todo and User file in server.js
- Todo model
- creating / Creating a second Todo model
- Todos
- adding, to database / Adding more Todos to the database
- fetching, from database / Making a request to fetch the Todos from the database
- todos
- fetching, in Robomongo file / Fetching todos in Robomongo file
- Todos script
- executing / Running the Todos script
- Todo text property
- customizing / Customizing the Todo text property
U
- uncommitted files
- commit, creating / Making a commit with the current uncommitted files
- update event listener
- testing / Testing the update event listener
- URL structure
- sorting / Sorting out the URL structure
- user connection
- testing / Testing the user connection
- user experience improvements
- making / Making user experience improvements
- user list
- updating / Wiring up user list
- People list, adding in chat room / Adding People list in the chat room
- users, removing when left from chatroom / Removing users when they leave the chatroom
- updating, when users left from chatroom / Updating the users list when someone left the chatroom
- users name, rendering to chatroom / Rendering the users name to the chatroom
- updated users list, committing / Making a commit for updated users list
- users
- greeting / Greeting an individual user
- broadcasting, in chat / Broadcasting a new user in the chat
- scrolling / Scrolling a user when necessary
- storing, with ES6 class / Storing users with ES6 classes – Part I
- users class, adding / Adding the users class
- removeUser method, adding / Adding the removeUser, getUser, and getUserList methods
- getUser method, adding / Adding the removeUser, getUser, and getUserList methods
- getUserList method, adding / Adding the removeUser, getUser, and getUserList methods
- seed data, adding for test file / Adding seed data for the test file
- getUserList, filling / Filling the getUserList
- test case, adding for getUserList / Adding test case for getUserList
- getUser, filling / Filling the getUser
- should find user test case / Test case – should find user
- should not find user test case / Test case – should not find user
- removeUser method, filling / Filling the removeUser method
- should remove user test case / Test case – should remove a user
- should not remove user test case / Test case – should not remove user
- removing, when left from chatroom / Removing users when they leave the chatroom
- custom message, emitting / Emitting custom message
- users, adding to list with jQuery / Adding a jQuery to add the users to the list
- updated People list, rendering / Rendering the updated People list
- users name, testing in chatroom / Testing the users name in the chatroom
- users class
- adding / Adding the users class
- test case, adding for addUser / Adding the test case for addUser
- Users file
- configuring / Configuring the Todo and Users file
- loading, in server.js / Loading Todo and User file in server.js
- users name
- rendering, to chatroom / Rendering the users name to the chatroom
- users, adding to list with jQuery / Adding a jQuery to add the users to the list
- utility function
- used, for generating the newMessage object / Generating the newMessage object using the utility function
- integrating, into application / Integrate the utility function into our application
W
- web app project
- creating / Creating a new web app project
- Windows
- MongoDB, installing / Installing MongoDB and Robomongo for Windows
- Robomongo, installing / Installing MongoDB and Robomongo for Windows
- data, creating / Creating and reading data
- data, reading / Creating and reading data