Skip to content

Commit

Permalink
Frontend: use top level api path + fix duration in html
Browse files Browse the repository at this point in the history
  • Loading branch information
mcorbin committed Jul 6, 2024
1 parent b225d3a commit 139946b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion http/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2 class="subtitle {{ if .Success}}subtitle-success{{else}}subtitle-failure{{en
<li><b>Summary</b>: {{.Summary }}</li>
<li><b>Source</b>: {{.Source }}</li>
<li><b>Timestamp</b>: {{ formatts .HealthcheckTimestamp }}</li>
<li><b>Duration</b>: {{ .Duration }} seconds</li>
<li><b>Duration</b>: {{ .Duration }} milliseconds</li>
</ul>
{{ if .Labels }}<br/>
{{ range $key, $value := .Labels }}
Expand Down
8 changes: 4 additions & 4 deletions http/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ func (c *Component) handlers() {
return ec.JSON(http.StatusOK, result)

})
apiGroup.GET("/frontend", func(ec echo.Context) error {
err := ec.Redirect(http.StatusFound, "/api/v1/frontend/index.html")
c.Server.GET("/frontend", func(ec echo.Context) error {
err := ec.Redirect(http.StatusFound, "/frontend/index.html")
return err
})
apiGroup.GET("/frontend/*", func(ec echo.Context) error {
path := strings.TrimPrefix(ec.Request().URL.Path, "/api/v1/frontend/")
c.Server.GET("/frontend/*", func(ec echo.Context) error {
path := strings.TrimPrefix(ec.Request().URL.Path, "/frontend/")

if path == "" {
path = "index.html"
Expand Down

0 comments on commit 139946b

Please sign in to comment.