fix: add opt-in appendAutoPrefix for directory auto prefixes#498
fix: add opt-in appendAutoPrefix for directory auto prefixes#498SergioChan wants to merge 2 commits intofastify:mainfrom
Conversation
README.md
Outdated
|
|
||
| ### `appendAutoPrefix` (optional) - Default: `false` | ||
|
|
||
| When `true`, `plugin.autoPrefix` is appended to the directory-derived prefix (from `dirNameRoutePrefix`) instead of replacing it. |
There was a problem hiding this comment.
it's totally unclear what this does from looking at this statement
There was a problem hiding this comment.
Thanks — addressed in commit c5cf899.
I rewrote this section to explicitly describe both modes (�ppendAutoPrefix: false vs rue) and included concrete resulting route paths so the behavior is easier to understand at a glance.
| dir: path.join(__dirname, 'routes'), | ||
| appendAutoPrefix: true | ||
| }) | ||
| ``` |
There was a problem hiding this comment.
Good call — updated in commit c5cf899.
The README example now uses a concrete directory + �utoPrefix setup and shows the exact resulting paths for both default mode and append mode.
|
Thanks for the review — I pushed an update to clarify the behavior and example in README. What changed:
Validation:
If you want, I can also add a short one-line cross-reference from |
Summary
appendAutoPrefixautoload option (defaultfalse)plugin.autoPrefixstill overrides directory-derived prefixes)appendAutoPrefix: true, concatenate directory prefix +plugin.autoPrefixIssue
Closes #205
Validation
node --test test/issues/205/test.jsnode --test test/commonjs/basic.js