-
Notifications
You must be signed in to change notification settings - Fork 42
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
Serve UI directly at the route prefix, rather than redirecting #144
Conversation
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.
noRedirect is not about not redirecting but actually about some routing option. This seems kind of wrong.
5328b13
to
09010c2
Compare
Thanks for the feedback. Any suggestion on what I should call it? Otherwise, is the general approach to this ok? |
Why do we even redirect? I have unfortunately currently no motivation to deep dive into the topic. But maybe not redirecting but directly serving the expected files should be the desired result? Maybe related to |
I did the redirect because I was too lazy to figure out how to make that rendering work correctly. At the beginning, the HTML was entirely static, so just redirecting it makes sense. Maybe we should flip it to |
Any decision on this? |
I think dropping the redirect entirely seems the best option. Would you like to take care of that? @Uzlopak would you be ok if that was the case? |
0c494c8
to
27a8126
Compare
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.
lgtm
Can you update the OP? |
There's a couple of changes to make - issues with trailing slashes that I am ironing out and test failures. Almost there, and I'll rebase it on updated master. |
27a8126
to
0717103
Compare
Ok, code is updated and I think in a good state. The changes are mainly because you can access the documentation route with or without a trailing slash, and this changes the behaviour of the relative imports used in the html. So, I have needed to handle this, by pasing the url of the request into the html template. If there's a simpler way, I'm all ears, but I wanted to make sure this honoured either trailing slash option (which I believe can be overidden at the server level, so this should handle both just in case?) Tests are updated to reflect this, and new e2e test cases make sure that the import of static assets, and the correct url for the json spec is used (which it wasn't before, but I hadn't noticed). I hope that all makes sense. |
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.
lgtm
Can you update the OP?
noRedirect
to serve UI directly at the route prefix
Yes, dropping it is imho the best option. |
This PR is related to #117. I like the suggestion, and it would be beneficial to me to have this feature, so I've implemented it.
Previously, when visiting the swagger UI route (default
/documentation
), the page redirected to/documentation/static/index.html
to display the UI. This no longer is the case, rather the UI is served directly.This should not affect any existing links to
/documentation/static/index.html
as they will be redirected to/documentation
and function as before.Checklist
npm run test
andnpm run benchmark
and the Code of conduct