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

Allow serving static assets from baseDir #108

Merged
merged 4 commits into from
Dec 15, 2023

Conversation

davidjbng
Copy link
Contributor

@davidjbng davidjbng commented Dec 6, 2023

Resolves #65

This PR documents how to serve static swagger-ui files from a custom directory and fixes serving static assets when the baseDir option is set.

Checklist

@Uzlopak Uzlopak requested review from mcollina, Eomm and Fdawgs December 6, 2023 12:41
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

Copy link
Member

@Fdawgs Fdawgs left a comment

Choose a reason for hiding this comment

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

Few issues with doc changes.
Will flesh this out once I'm finished at work.

@mcollina
Copy link
Member

@Fdawgs ptal

README.md Outdated Show resolved Hide resolved
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
@Uzlopak Uzlopak requested a review from Fdawgs December 13, 2023 08:48
@DavidTanner
Copy link
Contributor

Any idea on when this can be merged?

@Uzlopak Uzlopak merged commit 267f38f into fastify:master Dec 15, 2023
29 checks passed
@knolleary
Copy link
Contributor

I'm concerned this is a breaking change in behaviour and needs to be highlighted as such when it gets published - but would like a second opinion.

Prior to this change, if you set baseDir, the swagger static content would be served from the static folder included with this module. You could then set baseDir to point at another directory of content that should served in addition.

With this change, if you set baseDir it expects you to have copied the static folder included with this module into your baseDir.

So a working configuration prior to this PR will no longer work when this PR is applied.

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.

Esbuild and fastify-swagger-ui build output can't access the swagger-ui-dist static files.
6 participants