19 lines
336 B
Go
19 lines
336 B
Go
package beacon
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
var (
|
|
apiServeMux = http.NewServeMux()
|
|
)
|
|
|
|
func init() {
|
|
http.Handle("/beacon/", http.StripPrefix("/beacon", apiServeMux))
|
|
}
|
|
|
|
func RegisterApi(version string, handler http.Handler) {
|
|
apiServeMux.Handle(fmt.Sprintf("/%s/", version), http.StripPrefix(fmt.Sprint("/", version), handler))
|
|
}
|