go-paste/app.info.go
xuu 2cbd981902
Some checks failed
Go Bump / bump (push) Successful in 34s
Deploy / deploy (push) Failing after 48s
chore: remove v1
2023-11-05 08:45:07 -07:00

30 lines
483 B
Go

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()
fmt.Fprint(w, name, version)
})
}