feat: create standalone native fnOS repository
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/havline/havline/internal/discovery"
|
||||
)
|
||||
|
||||
type DiscoveryHandler struct {
|
||||
svc *discovery.Service
|
||||
}
|
||||
|
||||
func NewDiscoveryHandler(svc *discovery.Service) *DiscoveryHandler {
|
||||
return &DiscoveryHandler{svc: svc}
|
||||
}
|
||||
|
||||
func (h *DiscoveryHandler) Scan(w http.ResponseWriter, r *http.Request) {
|
||||
host := r.URL.Query().Get("host")
|
||||
writeJSON(w, http.StatusOK, h.svc.Scan(r.Context(), host))
|
||||
}
|
||||
Reference in New Issue
Block a user