Week 11 - Saturday, June 26th

Class Video

Update Main Branch

Here are the directions for how to incorporate updates on the main branch into another branch

Practice Problems

If you are finding these problems difficult, you can go to this site and focus on the problems that are in the "Very Easy" JavaScript category. If you sign-in, you can practice on the site, and you are allowed to unlock the answers.

The solutions are in the next section below.

Other Solutions

Review Back-end

Node.js

Node.js, npm

Node.js is a JavaScript runtime environment that runs on a web server and includes the JavaScript engine built by Google.

http module - provides support for building a web servers

Node Package Manager (npm) to manage external dependencies

Express.js

Express

Express.js is a JavaScript library that simplifies the process of creating a web server and registering endpoints with the web server so that the requests from your JavaScript code on the client are routed to the correct code within the Web API.

Basic Web Server

Restful API

Conventions have been established for how to structure web APIs, especially for those that are public.

REST stands for REpresentational State Transfer. It is an architectural model to organize interactions between independent systems. RESTful applications commonly use HTTP requests to post data (create and/or update), read data (e.g., make queries), and delete data.

CRUD

HTTP Verb

URL

Description

Read

GET

/api/order

Returns all order

Read

GET

/api/order/3

Returns order #3

Create

POST

/api/order

Creates new order

Update

PUT

/api/order/3

Updates order #3

Delete

DELETE

/api/order/3

Deletes order #3

Express Routing - Code Organization

Express provides a mechanism to move the Express handlers for different MongoDB document collections to separate files.

MongoDB

SQL vs NonSQL Databases

SQL

NonSQL

Mongoose

Mongoose is a Object Document Manager for Node.js, which is a library that allows you to define schemas for your MongoDB data and provides utilities for mapping the MongoDB data to JavaScript objects.

Homework

For this class, focus on increasing your basic JavaScript skills by reviewing all of the practice problems within this topic, as well as the ones from Week 10, Saturday. I have supplied all of the solutions to both my problems and the ones from code wars.

If these are not coming easily to you, you should be spending a couple of hours a day practicing them.

Also, walk through the code in my solution for the labs/article-summary and try to follow the sequence of steps all the way from the client through the server and back.

Last updated

Was this helpful?