curriculum
curriculum copied to clipboard
Node Controllers: Remove express-async-handler content
Because
Express v5 has been the npm current for a while i.e. what will be installed with npm install express, and rejected Promise support for async middleware is now built-in: https://expressjs.com/en/guide/migrating-5.html#rejected-promises. express-async-handler is no longer needed.
I've tested this and can confirm the exact same behaviour built in:
Crashes server in v4, catches and calls next(err) in v5:
app.get('/', async () => {
throw new Error('catch me!');
};
Required in v4 to catch and call next(err) in v4:
const asyncHandler = require('express-async-handler');
app.get('/', asyncHandler(async () => {
throw new Error('catch me!');
});
This PR
- Removes content on
express-async-handler - Rewords relevant sentences
Issue
N/A
Additional Information
Pull Request Requirements
- [x] I have thoroughly read and understand The Odin Project curriculum contributing guide
- [x] The title of this PR follows the
location of change: brief description of changeformat, e.g.Intro to HTML and CSS lesson: Fix link text - [x] The
Becausesection summarizes the reason for this PR - [x] The
This PRsection has a bullet point list describing the changes in this PR - [x] If this PR addresses an open issue, it is linked in the
Issuesection - [x] If any lesson files are included in this PR, they have been previewed with the Markdown preview tool to ensure it is formatted correctly
- [x] If any lesson files are included in this PR, they follow the Layout Style Guide