Express middleware for matching incoming requests (method + URL) to a pattern, commonly used to conditionally apply further middleware or route handlers. Latest version 0.1.3, released sporadically. Minimal utility with no dependencies; relies on Express's req.method and req.originalUrl for pattern matching. Not actively maintained, with only a few releases. Simpler than full-featured route-matching libraries like express-path-match or find-my-way, but may not support advanced patterns or wildcards.
npm install express-match-requestVerified import paths — ran on the pinned version, not inferred.
Demonstrates using matchRequest as middleware to conditionally handle GET /api/users and serve static files on /public.
Use a library like express-path-match for parameterized routes.
Consider alternatives like find-my-way or express-path-match.
Ensure subsequent middleware handles non-matched methods correctly.
Use default import: import matchRequest from 'express-match-request'
Run: npm install express-match-request
Ensure you pass method and pattern: app.use(matchRequest('GET', '/path'), handler)