MCPcopy Create free account
hub / github.com/cairoeth/preconfirmations / Start

Method Start

preconf-operator/receiverapi/receiverapi.go:50–62  ·  view source on GitHub ↗

Start starts the receiver api server in a goroutine

()

Source from the content-addressed store, hash-verified

48
49// Start starts the receiver api server in a goroutine
50func (api *ReceiveAPI) Start() <-chan error {
51 api.logger.Infof("Starting receiver api server at address %v", api.ipPortAddr)
52
53 mux := http.NewServeMux()
54 httpServer := http.Server{
55 Addr: api.ipPortAddr,
56 Handler: mux,
57 }
58
59 mux.HandleFunc("/receive", api.receive)
60 errChan := run(api.logger, &httpServer)
61 return errChan
62}
63
64func (api *ReceiveAPI) receive(w http.ResponseWriter, r *http.Request) {
65 decoder := json.NewDecoder(r.Body)

Callers 1

operatorMainFunction · 0.45

Calls 1

runFunction · 0.85

Tested by

no test coverage detected