mirror of
https://github.com/safing/portbase
synced 2025-09-01 10:09:50 +00:00
Fix enable server flag
This commit is contained in:
parent
b174b27ccd
commit
d6337281e3
1 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// EnableServer defines if the HTTP server should be started.
|
// EnableServer defines if the HTTP server should be started.
|
||||||
const EnableServer = true
|
var EnableServer = true
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// mainMux is the main mux router.
|
// mainMux is the main mux router.
|
||||||
|
@ -37,14 +37,14 @@ var (
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterHandler registers a handler with the API endoint.
|
// RegisterHandler registers a handler with the API endpoint.
|
||||||
func RegisterHandler(path string, handler http.Handler) *mux.Route {
|
func RegisterHandler(path string, handler http.Handler) *mux.Route {
|
||||||
handlerLock.Lock()
|
handlerLock.Lock()
|
||||||
defer handlerLock.Unlock()
|
defer handlerLock.Unlock()
|
||||||
return mainMux.Handle(path, handler)
|
return mainMux.Handle(path, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterHandleFunc registers a handle function with the API endoint.
|
// RegisterHandleFunc registers a handle function with the API endpoint.
|
||||||
func RegisterHandleFunc(path string, handleFunc func(http.ResponseWriter, *http.Request)) *mux.Route {
|
func RegisterHandleFunc(path string, handleFunc func(http.ResponseWriter, *http.Request)) *mux.Route {
|
||||||
handlerLock.Lock()
|
handlerLock.Lock()
|
||||||
defer handlerLock.Unlock()
|
defer handlerLock.Unlock()
|
||||||
|
|
Loading…
Add table
Reference in a new issue