hoangvvo / next-connect

The TypeScript-ready, minimal router and middleware layer for Next.js, Micro, Vercel, or Node.js http/http2
https://www.npmjs.com/package/next-connect
MIT License
1.62k stars 65 forks source link

Allow regular expressions to be used for route. #157

Closed mmillies closed 2 years ago

mmillies commented 2 years ago

Closes #156

changeset-bot[bot] commented 2 years ago

⚠️ No Changeset found

Latest commit: cd8868a1d7ddb3c03d7024d77ecaeb460777333a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

codecov[bot] commented 2 years ago

Codecov Report

Merging #157 (cd8868a) into master (0408c2e) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #157   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           80        81    +1     
=========================================
+ Hits            80        81    +1     
Impacted Files Coverage Δ
src/index.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0408c2e...cd8868a. Read the comment docs.

mmillies commented 2 years ago

hi. any feedback on this would be appreciated.

if it hasn't been looked at for a reason, perhaps I can resolve any grievances to move it forward?

hoangvvo commented 2 years ago

hi. any feedback on this would be appreciated.

if it hasn't been looked at for a reason, perhaps I can resolve any grievances to move it forward?

My apology! There is no grievances or anything. I totally forgot about the PR.

If Regex is to supported in .use(), I think we should add that support for method routing (.get, .set, etc.) too. The only method that need to be modify is the add() method.

mmillies commented 2 years ago

hi. any feedback on this would be appreciated. if it hasn't been looked at for a reason, perhaps I can resolve any grievances to move it forward?

My apology! There is no grievances or anything. I totally forgot about the PR.

No worries.

If Regex is to supported in .use(), I think we should add that support for method routing (.get, .set, etc.) too. The only method that need to be modify is the add() method.

Makes sense. I'll make the modifications at some point in the next few days. Thanks.

mmillies commented 2 years ago

updated. I'm open to any simplifications you can think of that might apply.

hoangvvo commented 2 years ago

Awesome! LGTM

hoangvvo commented 2 years ago

Released in v0.11.0!