Hello, I have been struggling with the understanding of when to properly apply next() and done() in my first node and express apps. Here is an outline of what I think I know:
- next() is to be used to pass the request to the next middleware?
- done() is only needed for exiting a callback hell?
- done() can be avoided using promises and async await?
Also I have been struggling understanding if my middleware is synchronous or awaiting:
- Is it blocking other requests to the route?
- Or does every request to the route instantiate a new “event” for lack of better terms?
Any thoughts or links to resources you found helpful would be greatly appreciated.