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

Swagger UI and openapi.json not available in Vercel Deployments #12

Open
ifjorissen opened this issue Oct 25, 2023 · 2 comments
Open

Swagger UI and openapi.json not available in Vercel Deployments #12

ifjorissen opened this issue Oct 25, 2023 · 2 comments

Comments

@ifjorissen
Copy link

Check the live demo-- https://nextjs-fastapi-starter.vercel.app/

According to next.config.js, the swagger UI should be at https://nextjs-fastapi-starter.vercel.app/docs, and the openapi.json at https://nextjs-fastapi-starter.vercel.app/openapi.json

However, both of those 404.

Have cloned this project locally & deployed it to vercel and can confirm I see the same behavior.

Any ideas on how to get the swagger ui and openapi.json to route correctly? Thanks!

@LennardSchwarz
Copy link

LennardSchwarz commented Nov 8, 2023

https://github.com/digitros/nextjs-fastapi/pull/9/files

Have you tried mapping the docs to the correct url while instantiating FastAPI like in this PR?

@riziles
Copy link

riziles commented Dec 4, 2023

@ifjorissen ,
If you have simply cloned this repo or clicked the "Deploy to Vercel" button, I believe the next.config.js is currently configured to only deploy the Swagger UI if process.env.NODE_ENV === "development" which is not the case in a production Vercel deployment.

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

No branches or pull requests

3 participants