INNER CODE UNIT · Go

createHTTPServer

nicholasjackson/fake-service · main.go:346

func createHTTPServer(
	hh *handlers.Health,
	rh *handlers.Ready,
	rq http.Handler,
	con *handlers.Config,
	logger *logging.Logger,
) *http.Server {
	mux := http.NewServeMux()

	// add the static files
	logger.Log().Info("Adding handler for UI static files")
	mux.Handle(*uiPath, http.StripPrefix(*uiPath, http.FileServer(http.FS(&embedFs{}))))

	// Add the generic health and ready handlers
	mux.HandleFunc("/health", hh.Handle)
	mux.HandleFunc("/ready", rh.Handle)

	// Add the config handler that allows modification of config values dynamically

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…