mirror of
https://github.com/lwch/natpass.git
synced 2024-04-21 12:41:54 +00:00
24 lines
369 B
Go
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()
|
|
}
|