Open geromegrignon opened 2 months ago
PR more than welcome to improve nitro docs 🙏🏼
Awesome I wanted to wait for feedback from the team before starting working on it. I'll land a PR!
@geromegrignon please a PR would be huge for this!
Using your example, I had my routes configured like this:
src/api/v1
- articles.get.ts
- articles.post.ts
- articles.delete.ts
src/api/v1/articles
- upcoming.get.ts
- upcoming.post.ts
It drove me crazy because I couldn't find any examples of doing this any other way while having a feeling it was possible and I was missing something. I only found this because my OCD finally had enough and I decided to spend an hour going through nearly every issue until I came across this.
Hi @ilyafish, sure I'll work on it tomorrow! Glad it already helped!
Describe the feature
The server routes documentation is missing a basic folder structure scenario, implying you are familiar with file-based routing structure.
It doesn't explain you can prefix files with
index
, likeindex.get.ts
.It unlocks using a folder for crud operations like:
Or being able to cover routes like
/articles
and/articles/upcoming
.Additional information