Router and Express Router Flashcards

1
Q

HTTP Request/Response Cycle

A
  1. browser parses the URL, looking for the domain name
  2. browser sends query with the domain name to the ISP(internet service provider)
  3. The ISP looks up domain in DNS (domain name system) and matches it to an IP (internet protocol) address
  4. ISP sends IP address back to the browser-response-all items collected to be parsed by the browser
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

URL

A
Uniform resource locator
Consists of:
1. protocol (http, https, ftp)
2. domain (mapped to IP address
3. port
4.path
5.query string
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Web server role

A

parse URLs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe the architecture of a basic Express app. How is it organized?

A

-architecture that allows for middleware?
-framework made up of 4 pieces:
1. express()
2. application
3. request
4. response
5. router
architecture:
data- database and schema
services available to route
API layer and routes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Express

A
  1. minimalist framework

2. designed to allow anyone to contribute functionality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

express()

A
  • The top-level function exported by the Express module. – when called it:
    1. creates an Express app
    2. gives us access to the other Express objects (application, request, response, router)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

(express) application

A
  1. object
  2. it is theExpress application itself
  3. provides methods to route HTTP requests
  4. provides methods to configure middleware
  5. provides other functionality relevant to constructing web applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

request

A
  1. Object that represents the HTTP request
  2. has properties to access the various features of the request such as query string, headers and so on.
  3. referred to as req
  4. passed to route handling methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

response

A
  1. Object that represents the HTTP response that is sent to the client when the request is completed.
  2. referred to as res
  3. passed to route handling methods.
  4. contains methods to format the response, set the response headers and status code.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

router

A
  1. mini- application

2. used to make apps more modular

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Tell me about a time when you’ve used Express Router. How was it helpful?

A

Express router:
a time I’ve used it- capstone!
super helpful in breaking up and organizing the different routes- much more manageable to work with the code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

unit testing

A

testing individual components

NEED EXAMPLE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

integration testing

A

how components behave when working with other components
uncover errors at the interface between components or communication between components
like testing the interactions of the router and the database and services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

interface

A

refers to the shared boundary across which components exchange data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

mocha

A

testing framework

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

chai

A

assertion library

17
Q

supertest

A

a tool for testing HTTP calls