INNER CODE UNIT · Go

func

nicholasjackson/fake-service · main.go:342

func (e *embedFs) Open(name string) (fs.File, error) {
	return uiFiles.Open(path.Join("ui/build", name))
}

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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…