-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add prefix #204
Add prefix #204
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not use prefix
as a name for this option as it's a common option in fastify plugins to identify a route prefix, e.g. /v1
. It's best to use a different name to avoid conflicts.
Maybe propertyName
, name
or exposeAs
.
I'll be back in a few hours and fix the conflict with the current version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please document this in the readme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm but what about showing the example you described in the issue?
Like having 2 different declarations with different propertynames calling different partials?
fastify.register(require('../index'), {
engine: { ejs: ejs },
layout: './templates/layout-mobile.hbs'
propertyName: 'mobile'
})
fastify.register(require('../index'), {
engine: { ejs: ejs },
layout: './templates/layout-desktop.hbs'
propertyName: 'desktop'
})
I think this is a revelant example to showcase this feature
Co-authored-by: Vincent LE GOFF <vince.legoff@gmail.com>
Checklist
npm run test
andnpm run benchmark
and the Code of conduct