Files
natpass/code/client/dashboard/dashboard.go
T
2021-10-12 15:10:33 +08:00

24 lines
369 B
Go

package dashboard
import (
"fmt"
"net/http"
)
// Dashboard dashboard object
type Dashboard struct {
}
func New() *Dashboard {
return &Dashboard{}
}
func (db *Dashboard) ListenAndServe(addr string, port uint16) error {
mux := http.NewServeMux()
svr := &http.Server{
Addr: fmt.Sprintf("%s:%d", addr, port),
Handler: mux,
}
return svr.ListenAndServe()
}