blomqma / next-rest-framework

Type-safe, self-documenting APIs for Next.js
https://next-rest-framework.vercel.app
Other
155 stars 20 forks source link

Fix `appDirPath` handling when not using src directory #71

Closed blomqma closed 1 year ago

blomqma commented 1 year ago

There is a bug when not using the src directory and using the App Router - if the user does not define the appDirPath config option having a slash as prefix, the framework won't be able to find the route handlers. This fixes that with a one-line change in the route discovery logic.

The typings for both appDirPath and apiRoutesPath options are also changed so that the following formats are now supported:

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-rest-framework ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2023 10:10am
next-rest-framework-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2023 10:10am