Express next() and done()

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?

It seems there has been many advancements in JavaScript and Node that I’m trying to wade through several different versions of tutorials and docs. I could use a little help with some subjects .

Any thoughts or links to resources you found helpful would be greatly appreciated.

Thank You.

Express and Node MDN Tutorial

I’m slowing down and following this tutorial right now. I think it will answer the questions that I have.