mtbrault / nextjs-http-supertest

npm package to get an http server parsing your nextJS app to link endpoint with handler
14 stars 5 forks source link

fix: matching longer-by-one route #8

Closed justin-caldicott closed 1 year ago

justin-caldicott commented 1 year ago

Given the following routes:

/users/[id]
/users

When making a request to /users we would expect the /users route to be resolved.

However the /users/[id] route is resolved. It tests this route first, and index === routeSplit.length - 1 evaluates to true.

mtbrault commented 1 year ago

Thank you, it has been published on npm