-
-
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
server swagger-ui using the swagger-ui-dist module #37
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
this should not be needed, maybe fastify-static has a bug. Why do you need it?
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.
this is needed since I do not change the file from the original and content of
swagger-ui-dist
remains the same. But I hijack the request to the root orindex.html
and send our custom file instead of the defaultindex.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 these prefixes are correct. I can mount this plugin with a given
/swagger
and it will add the ui as/swagger/documentation/
.A better approach would be to either have a
post-install
script or aprepublish
script where we do these changes and replacements. A prepublish might be better, because we can't guarantee that regexps are stable across versions. Why do we need those changes anyway?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.
This changes needed because by default it
index.html
of the swagger ui leads to the pet store.https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html
how would you do that? I think
prefix
option is not supported.I've tried this together with
example/dynamic.js
:the documentation appeared on
localhost:3000/documentation
still.you mean on prepublish we copy everything into our static folder and then serve it instead of the original
swagger-ui-dist
?Yes, the original
html
can be changed, but since the version is fixed, I think it's safe to rely on the regex.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.
Here is the new variant #39