Skip to content
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

Merged
merged 5 commits into from
May 9, 2018
Merged

Conversation

allevo
Copy link
Member

@allevo allevo commented May 7, 2018

Fix #65

Copy link
Member

@mcollina mcollina left a 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`)
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!! fixed

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina
Copy link
Member

mcollina commented May 9, 2018

Feel free to release it to land and release it to npm as minor!

@allevo
Copy link
Member Author

allevo commented May 9, 2018

@mcollina I have no right to merge this PR

@mcollina
Copy link
Member

mcollina commented May 9, 2018

Now you can :D

@allevo allevo merged commit 1d27e86 into fastify:master May 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants