-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Changes to improve swagger ui #3298
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,21 +17,11 @@ limitations under the License. | |
package apiserver | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
"net/http" | ||
|
||
"github.com/emicklei/go-restful" | ||
) | ||
|
||
// handleIndex is the root index page for Kubernetes. | ||
func handleIndex(req *restful.Request, resp *restful.Response) { | ||
// TODO: use restful's Request/Response methods | ||
if req.Request.URL.Path != "/" && req.Request.URL.Path != "/index.html" { | ||
notFound(resp.ResponseWriter, req.Request) | ||
return | ||
} | ||
resp.ResponseWriter.WriteHeader(http.StatusOK) | ||
// TODO: serve this out of a file | ||
data := "<html><body>Welcome to Kubernetes</body></html>" | ||
fmt.Fprint(resp.ResponseWriter, data) | ||
func HandleIndex(w http.ResponseWriter, r *http.Request) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the purpose of this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other than removing the go-restful args? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. Mainly removing the go-restful args. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, that's fine. Maybe this was a default handler at some point. |
||
io.WriteString(w, "<html><body>Welcome to Kubernetes</body></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.
It would be a little nicer to put AddApiWebService and APIVersionHandler (which could be changed to apiVersionHandler) next to each other, and handleVersion and InstallSupport (which could be renamed InstallVersion) next to each other, but that can be left to a future PR.