Skip to content

updated to ESM/Vitest references#2

Open
GinaCastromonte wants to merge 1 commit intomainfrom
assignment2-esm-vitest-updates
Open

updated to ESM/Vitest references#2
GinaCastromonte wants to merge 1 commit intomainfrom
assignment2-esm-vitest-updates

Conversation

@GinaCastromonte
Copy link
Collaborator

Converted Lesson2/ Assignment2 from Jest-style setup to Vitest-compatible ESM flow.

Copy link
Collaborator

@verafes verafes left a comment

Choose a reason for hiding this comment

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

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: ...404 - This is a common HTTP error.


**Exiting Cleanly**

Your Express program opens a port.
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: ...opens a network port

console.log("Path:", req.path);
console.log("Query:", req.query);
next();
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Style: missing semicolon after }) here and in line 20.

@@ -0,0 +1,69 @@
import express from "express";
import errorHandler from "../middleware/error-handler.js";
Copy link
Collaborator

Choose a reason for hiding this comment

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

According to the assignment instructions, app.js should import middleware from root using ./middleware/ (one dot)

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