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

Cant load swagger file in Nest app running with url prefix #32

Open
mo4islona opened this issue Apr 28, 2021 · 0 comments · May be fixed by #31
Open

Cant load swagger file in Nest app running with url prefix #32

mo4islona opened this issue Apr 28, 2021 · 0 comments · May be fixed by #31

Comments

@mo4islona
Copy link

mo4islona commented Apr 28, 2021

We should load swagger from relative url because nest application could be proxied with some path prefix by some server like NGINX behind.

For example, we have Nest app with simple /docs/ route. And some SPA application on same domain. We will configure NGINX like

location /api {
   // upstream to Nest app
}

location {
 // route everything didnt match /api prefix to static files
}

In these cause a broken link swagger.json because it will be generated from the root

And these why all static files are loaded in original SwaggerModule

<script src="./swagger-ui-bundle.js"> </script>
<script src="./swagger-ui-standalone-preset.js"> </script>
<script src="./swagger-ui-init.js"> </script>
@mo4islona mo4islona linked a pull request Apr 28, 2021 that will close this issue
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.

1 participant