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

Steps missing to serve static files #2752

Open
stmcginnis opened this issue Apr 1, 2022 · 0 comments
Open

Steps missing to serve static files #2752

stmcginnis opened this issue Apr 1, 2022 · 0 comments
Labels
question runtime Relates to github.com/go-openapi/runtime ui

Comments

@stmcginnis
Copy link

Problem statement

I have two parts of my application, the API that is defined by my swagger spec, and a static HTML UI. I would like to serve my API under the /api path and the UI under /ui.

I followed the instructions in https://github.com/go-swagger/go-swagger/blob/master/docs/faq/faq_documenting.md#how-to-serve-my-ui-files but it seems like I'm missing something else that isn't described in the docs. It looks like the requests for things under /ui aren't being routed to the middleware handler, and they result in a 404 response.

Is there another step required to wire up the middleware handling for my /ui route? Someone had suggested adding paths to the swagger spec, but since this isn't part of my API, I'd really rather not have to define every path for it in my API spec.

I'm sure I'm missing something basic here, but so far it hasn't been obvious to me. Any pointers would be appreciated. Happy to expand on the FAQ entry with a PR once I understand what's missing.

@fredbi fredbi added question runtime Relates to github.com/go-openapi/runtime ui labels Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question runtime Relates to github.com/go-openapi/runtime ui
Projects
None yet
Development

No branches or pull requests

2 participants