nitro icon indicating copy to clipboard operation
nitro copied to clipboard

Docs: explain index files for server routing

Open geromegrignon opened this issue 2 months ago • 4 comments

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, like index.get.ts.

It unlocks using a folder for crud operations like:

articles
  - index.get.ts
  - index.post.ts
  - index.delete.ts

Or being able to cover routes like /articles and /articles/upcoming.

articles
  index.get.ts
  upcoming
    index.get.ts

Additional information

  • [X] Would you be willing to help implement this feature?

geromegrignon avatar May 05 '24 18:05 geromegrignon