Add depot, attendant, jetfire, optimus, ota services with kustomize overlays
This commit is contained in:
23
services/optimus/server/server_http.go
Normal file
23
services/optimus/server/server_http.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"github.com/fiskerinc/cloud-services/services/optimus/handlers"
|
||||
|
||||
h "github.com/fiskerinc/cloud-services/pkg/httphandlers"
|
||||
"github.com/fiskerinc/cloud-services/pkg/logger"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
const port string = ":8077"
|
||||
|
||||
func StartHTTPServer() {
|
||||
router := httprouter.New()
|
||||
router.PanicHandler = h.HttpRouterPanicHandler
|
||||
addHandler(router, http.MethodGet, "/reset", handlers.ResetFilters)
|
||||
logger.Fatal().AnErr("http.ListenAndServe", http.ListenAndServe(port, router)).Send()
|
||||
}
|
||||
|
||||
func addHandler(router *httprouter.Router, method string, path string, handler http.HandlerFunc) {
|
||||
router.HandlerFunc(method, h.HttpRouterHandleBaseURL(path), handler)
|
||||
}
|
||||
Reference in New Issue
Block a user