Skip to content

wk2 lesson notes -- Griffiths#19

Open
crgriffiths wants to merge 4 commits intopce-uw-jscript400:masterfrom
crgriffiths:master
Open

wk2 lesson notes -- Griffiths#19
crgriffiths wants to merge 4 commits intopce-uw-jscript400:masterfrom
crgriffiths:master

Conversation

@crgriffiths
Copy link

No description provided.

* **Question:** Take a minute to look through the installed packages and describe the purpose of each one. Don't just copy and paste from something online!

* **Your Answer:**
* **Your Answer:** Body parser appears to parse response data. Express is a simple javascript server library for serving files from a Node backend. Morgan is a testing framework. Nodemon appears to be a task runner.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Morgan provides logs for dev purposes.

* **Question:** What type of thing is `app` and what is its purpose?

* **Your Answer:**
* **Your Answer:** App is a function and its various attached methods referencing the Express module.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
Also an event emitter and our running instance of the server.

* **Question:** The above can be described as middleware. Describe what middleware is in your own words and how it differs from building a route.

* **Your Answer:**
* **Your Answer:** Middleware is like a utility or helper for processessing requests. A route is an endpoint a client can make a request to. That endpoint would likely use that middleware to help process said request.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* **Question:** Try commenting out `body-parser` in your application. What happens and why?

* **Your Answer:**
* **Your Answer:** Nothing was logged. This is likely because the response object has not been properly handled or parsed.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants