-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Fix: redirect to index #67
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.
LGTM
routes.js
Outdated
@@ -7,7 +7,7 @@ function fastifySwagger (fastify, opts, next) { | |||
url: '/', | |||
method: 'GET', | |||
schema: { hide: true }, | |||
handler: (request, reply) => reply.redirect(`.${opts.prefix}/`) | |||
handler: (request, reply) => reply.redirect(`${opts.prefix}/index.html`) |
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 don't think that opts.prefix
here is correct. Can you add a test that loads this within another plugin, so that this is exposed as /v1/documentation
? I think it should use fastify.basePath
.
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.
nice catch!! fixed
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
Feel free to release it to land and release it to npm as minor! |
@mcollina I have no right to merge this PR |
Now you can :D |
Fix #65