Conversation
verafes
left a comment
There was a problem hiding this comment.
Looks excellent! Just a few small wording/style suggestions — feel free to ignore.
| node app.js | ||
| ``` | ||
|
|
||
| Go to your browser, and go to the URL http://localhost:3000. |
There was a problem hiding this comment.
Suggection: "Open your browser" instead of "Go to your browser"
| res.send("Hello, World!"); | ||
| }); | ||
| ``` | ||
| In this case, the browser does see a response, but in the server log, you see a bad error message. |
There was a problem hiding this comment.
Sugestion: 'browser does see' -> 'browser does receive'.
Wondering what does "bad error message" means here? - unclear? misleading? incomplete? unexpected?
|
|
||
| ## More Middleware | ||
|
|
||
| Try this URL: http://localhost:3000/nonsense. Again, you get an error — a 404. You've seen those. You need to handle this case. |
There was a problem hiding this comment.
suggestion: ...404 - This is a common HTTP error.
|
|
||
| **Exiting Cleanly** | ||
|
|
||
| Your Express program opens a port. |
There was a problem hiding this comment.
suggestion: ...opens a network port
| console.log("Path:", req.path); | ||
| console.log("Query:", req.query); | ||
| next(); | ||
| }) |
There was a problem hiding this comment.
Style: missing semicolon after }) here and in line 20.
| @@ -0,0 +1,69 @@ | |||
| import express from "express"; | |||
| import errorHandler from "../middleware/error-handler.js"; | |||
There was a problem hiding this comment.
According to the assignment instructions, app.js should import middleware from root using ./middleware/ (one dot)
Converted Lesson2/ Assignment2 from Jest-style setup to Vitest-compatible ESM flow.