...

Source file src/edge-infra.dev/cmd/sds/novnc/integration/mocks/gateway/main.go

Documentation: edge-infra.dev/cmd/sds/novnc/integration/mocks/gateway

     1  package main
     2  
     3  import (
     4  	"net/http"
     5  	"os"
     6  
     7  	"edge-infra.dev/pkg/lib/logging"
     8  )
     9  
    10  func returnHostName(w http.ResponseWriter, _ *http.Request) {
    11  	w.WriteHeader(http.StatusOK)
    12  }
    13  
    14  func main() {
    15  	logger := logging.NewLogger().WithName("vncgateway")
    16  	logger.Info("Starting server")
    17  	http.HandleFunc("/", returnHostName)
    18  	/* #nosec G114 */
    19  	if err := http.ListenAndServe("0.0.0.0:8080", nil); err != nil { //nolint:gosec // not used for security
    20  		logger.Error(err, "Server error")
    21  		os.Exit(1)
    22  	}
    23  }
    24  

View as plain text