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.64k stars 65 forks source link

Express Router compatibility #121

Closed hoangvvo closed 3 years ago

hoangvvo commented 3 years ago

This allows next-connect to consume Router created by express. To do so, we strip base from req.url (breaking) for subapp. Previously we do not mutate req.url so express router is not aware of the baseUrl. (Fix #121)

Also add an option to set req.params and some docs. (Fix #110)

We also remove the deprecated apply() function

changeset-bot[bot] commented 3 years ago

⚠️ No Changeset found

Latest commit: 38fef37581aa66ec09019b5910e657e36d575399

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 3 years ago

Codecov Report

Merging #121 (38fef37) into master (efd72ef) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #121   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           47        51    +4     
=========================================
+ Hits            47        51    +4     
Impacted Files Coverage Δ
lib/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 efd72ef...38fef37. Read the comment docs.