CSCI 446 Unit #10
Preparation:
You will need to download and install Postman. The textbook
shows Postman as a Chrome extension, but Chrome extensions are deprecated
(see
http://blog.getpostman.com/2017/11/01/goodbye-postman-chrome-app/).
You should be able to find the app at
https://www.getpostman.com/apps.
You will need a way to do screen captures. I use ScreenHunter free, but
there are other options. Post suggestions or questions on piazza.
Read Chapter 6 in Getting Mean. This chapter
that covers a number of really important concepts - be sure to
think about the ideas, which apply to many web frameworks, not just MEaN.
- Figure 6.1. Where does the API fit in the overall architecture?
- What does REST stand for? By the end of the chapter you should
understand what it means if someone says they have a RESTful application/API.
- What does API stand for?
- Figure 6.2. Request-response is an important
architecture/design pattern to understand.
- What does CRUD stand for?
- Table 6.1. An important part of web design is mapping URLs
to actions.
- Table 6.2. Be sure to understand the request methods
listed in the table. These will be used for any framework that
follows the REST architecture (e.g., Rails, Laravel, etc.).
- Table 6.3 shows how the same verb (GET in this table) can have
different actions depending on the parameters. Also take a close
look at table 6.4.
- What are the 2 components of a standard REST response?
- What kind of data might be returned as a REST response? Note that
we'll have to deal with these options in code.
- Take a quick look at table 6.5. I'm sure you'll recognize some
of the status codes.
- Why do we want to keep the API code separate from the rest of the
application? NOTE: as a result, we will have
routes
and
controllers
, with similar names (e.g., locations
), in both the
API and the application. This can get confusing, so be sure to
reflect on the directory structure and purpose of each folder
as you proceed through the tutorial. Don't just blindly follow the
tutorial, you should be very clear about why we have these similar files.
Post on piazza if it's not clear.
- Notice the mongoose query methods. It's important to understand that
these do not start the query, they just determine what the query will
be. This is a fairly common way of interacting with a database.
- What is a query string? How do we access parameters from the query
string from within Express?
- Walk carefully through the rest of the chapter. You can skim or skip the information
related to geospatial queries (6.3.3).