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

plugin config routePrefix breaks the page #165

Closed
2 tasks done
blue86321 opened this issue Jul 25, 2024 · 2 comments · Fixed by #170
Closed
2 tasks done

plugin config routePrefix breaks the page #165

blue86321 opened this issue Jul 25, 2024 · 2 comments · Fixed by #170

Comments

@blue86321
Copy link
Contributor

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.28.1

Plugin version

4.0.1

Node.js version

20.x

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

14.5

Description

When we config the routePrefix parameter like below

import { fastifySwaggerUi } from "@fastify/swagger-ui";
fastify.register(fastifySwaggerUi, { routePrefix: "/api/docs" })
  • It breaks the documentation page as the css/js resource double the api prefix.
    image

  • The resource can be visited by manually twisting the url
    image

  • Removing the routePrefix, the documentation can be rendered correctly
    image

Link to code that reproduces the bug

No response

Expected Behavior

The documentation page should be rendered correctly even with routePrefix config

@blue86321
Copy link
Contributor Author

It works on version 4.0.0, I doubt it's because of this PR #164

@mcollina
Copy link
Member

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

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 a pull request may close this issue.

2 participants