WIP: obs-status-service: add default landing page for root URL #115
Reference in New Issue
Block a user
Delete Branch "schrodinger/autogits:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR improves the behavior of the root endpoint (
GET /) of the OBS Status Service.Previously, the root URL always returned a
404 page not foundresponse when the service was healthy. This change replaces that 404 response with a simple HTML landing page that explains how to use the service.Specifically, the following changes were made in
obs-status-service/main.go:The existing
GET /handler was updated to return HTTP 200 instead of 404.A basic HTML landing page is now served at the root endpoint.
The landing page content is derived from the existing README and explains how
/status/...URLs work.Example
/status/...URLs are shown so users can quickly understand the expected format.A small client-side only form was added that helps users build:
No backend logic was added for the form. It only concatenates URL path segments based on user input and relies on the existing
/status/*endpoints.This change does not modify or affect any existing
/status/*handlers or backend logic.Testing
The landing page HTML and form behavior are fully client-side and were tested independently in a browser.
Running the full service locally requires access to Redis and OBS, so the backend was not executed locally. The change is limited to the root endpoint and does not interact with Redis or OBS.
Related
Fixes https://src.opensuse.org/git-workflow/autogits/issues/114
@schrodinger Can you clean this PR? Just rebase your branch on main and left just one commit with the relevant changes.
https://git-scm.com/docs/git-rebase#_interactive_mode
48a32170b8to059ffffbddThanks for the suggestion. I’ve rebased the branch on main and cleaned the PR to contain a single commit.
obs-status-service: add default landing page for root URLto WIP: obs-status-service: add default landing page for root URLIt's a good start!
@@ -41,6 +41,107 @@ const (AppName = "obs-status-service")const indexHTML = `<!DOCTYPE html>Instead of harcode the html in this file, you can create a folder, for example
staticand add theindex.htmlfile there, and then return the file directly.059ffffbddtoaeb3917591Done, I’ve moved the landing page into static/index.html and updated the root handler to serve it directly. Thanks for the suggestion!
1243ba4c6etoaeb3917591Closing this PR to create a new clean PR rebased on the latest upstream main.
Pull request closed