2023-10-19 17:05:41 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"go.sour.is/pkg/lg"
|
|
|
|
"go.sour.is/pkg/service"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ = apps.Register(50, func(ctx context.Context, svc *service.Harness) error {
|
|
|
|
_, span := lg.Span(ctx)
|
|
|
|
defer span.End()
|
|
|
|
|
|
|
|
svc.Add(&info{})
|
|
|
|
|
|
|
|
return nil
|
|
|
|
})
|
|
|
|
|
|
|
|
type info struct{}
|
|
|
|
|
|
|
|
func (info) RegisterHTTP(mux *http.ServeMux) {
|
|
|
|
mux.HandleFunc("/app-info", func(w http.ResponseWriter, r *http.Request) {
|
|
|
|
name, version := service.AppName()
|
2024-01-22 16:05:13 -07:00
|
|
|
fmt.Fprint(w, name, '@', version)
|
2023-10-19 17:05:41 -06:00
|
|
|
})
|
|
|
|
|
|
|
|
}
|