How to skip a middleware in Express.js ?
If we want to skip a middleware we can pass parameters to the middleware function and decide based on that parameter which middleware to call and which middleware to not call.
- express.js: To handle routing.
Setting up environment and execution:
Step 1: Initialize node project
Step 2: Install required modules
npm install express
Output: Run the below command to start the server. After that go to http://localhost:5000 on browser to see output in console
- In browser.