What is middleware in Express?
A function that runs between the request and the response. It can modify the request, end the response, or call the next middleware. Auth, logging, and error handling are common middleware in Express apps.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Node.js Interview Questions Every Beginner Should Know
Node.js is a JavaScript runtime built on Chrome's V8 engine that runs JavaScript on the server. It uses libuv for async I/O and an event loop to process callbacks non-blockingly on a single thread.
A single-threaded loop that processes callbacks from completed async operations. It is what makes Node.js non-blocking and efficient for concurrent I/O, since the main thread is not blocked waiting for operations to complete.
Sync code blocks the main thread until it completes. Async code returns immediately and runs a callback when done, letting the event loop process other work. Always prefer async for I/O operations.
Still have questions?
Browse all our FAQs or reach out to our support team
