-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotes
29 lines (18 loc) · 892 Bytes
/
Notes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Questions/notes (Dec. '16):
npm install express? (Error: Cannot find module 'express')
package.json via npm process - entry point index.js
Set up:
- ignore config files?
Node:
- node/v6.6.0 - or install 6.9.1?
- Start server w/ npm start?
API:
- JSON doesn't seem to be supported > using npm path/xmlToJSON.js
Express lecture:
- Express requires middleware, listens for requests & passes req & resp objects to request handler via routeHandler
- routeHandler can change the obj to add functionality - it handles the requests
- Middleware takes 3 arg: resp, req, & next (like callback)
- Next is primary request handler, which will send the response back or invoke a function, etc.
- Need app.use to apply the MW
// Wasn't sure re using Chatterbox server approach vs. the one in Angular sprint
// Joseph said to use the one in Shortly Express; server will just serve the static page