TeamTreehouse-Express-Basics - Teacher's Notes

1.1 An Intro: Express.js is amazing

1.2 Install Express.js

1.3 Your First Express App

1.4 Improving your first app, some final touches

2.1 Adding Routes to the App

2.2 Easily Debug Express (and other node apps)

2.3 Interactive Debugging and Exploratory Programming

First terminal: node-inspector Second terminal: nodemon --debug-brk src/app.js

3.1 Requests and the request object

3.2 Responses and the Response Object

4.1 What is Template Rendering?

A comparison of JavaScript Template Engines: https://strongloop.com/strongblog/compare-javascript-templates-jade-mustache-dust/

4.2 What is Jade? > Renamed PugJS

The PugJS Website: https://pugjs.org/api/getting-started.html

4.3 Using Jade > Pug in your Express App

4.5 Scaffolding Your Project's Templates

4.6 SYPT - adding "partials"

5.1 Setting Up the Express Static Server in Development

!! Middleware is the logic that tells Express how to handle a request inbetween the time a request is made by the client but before it arrives at a route.

5.2 Add Static to the Layout Template

6.1 Making Lists in Pug Templates

  • Jade let’s you iterate over objects: http://jade-lang.com/reference/iteration/ However, in our case, iterating over our “mock” post data as an object would be even less realistic. In a JavaScript application, when data is meant to be iterated through, it will typically be provided in an array format.

  • Note the other syntax you can use. For example for post in posts.

6.2 Using Logic in Pug Templates

6.4 Where do I go from here?