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: static content for routePrefix with subpath (#165) #170

Merged
merged 1 commit into from
Aug 14, 2024

Conversation

miraries
Copy link
Contributor

@miraries miraries commented Aug 3, 2024

This fixes #165, where having a subpath in routePrefix breaks static content loading due to changes in #164.

Now the static content urls are relative only with a trailing slash, otherwise they're absolute - meaning they work the same as before the regression.

The tests for this were already developed but with wrong assertions, to be able to test static content is loaded I assume we'd need to run playwright with different prefix variations, which would require a refactor as all playwright tests are run with /documentation as the prefix.
Please let me know if you have any suggestions regarding the tests.

Checklist

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 mcollina merged commit 4540c0c into fastify:master Aug 14, 2024
14 of 16 checks passed
@KharchenkoDmitriy
Copy link

Experienced related issue with swagger-ui in module
When register swagger ui on top level with routePrefix: "/docs" it works
When register it inside a module with routePrefix: "/docs", it cannot serve static

Reading this PR guide me to the solution - routePrefix: "docs" which solve static serving issue
Not sure if it is expected behavior but it would be nice to mention it in Docs/Readme

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.

plugin config routePrefix breaks the page
3 participants