smarter variable name. predicts a logpb

This commit is contained in:
Jeff Carr 2025-09-09 17:05:05 -05:00
parent 47cd147ca0
commit c0f0414ff8
2 changed files with 26 additions and 1 deletions

View File

@ -24,7 +24,7 @@ message HttpRequest { // HttpRequest repre
int64 clientDataLen = 12; // len(body)
bytes serverData = 13; // the server response
int64 serverDataLen = 14; // len(data)
repeated string log = 15; // use this to store whatever you want while the whole POST happens
repeated string logs = 15; // use this to store whatever you want while the whole POST happens
}
message HttpRequests { // `autogenpb:marshal` `autogenpb:mutex`

25
startHTTP.go Normal file
View File

@ -0,0 +1,25 @@
// Copyright 1994-2025 WIT.COM Inc Licensed GPL 3.0
package httppb
import (
"fmt"
"net/http"
"go.wit.com/log"
)
// starts and sits waiting for HTTP requests
func StartHTTP(okHandler func(http.ResponseWriter, *http.Request), port int) error {
http.HandleFunc("/", okHandler)
p := fmt.Sprintf(":%d", port)
log.Println("Running on port", p)
err := http.ListenAndServe(p, nil)
if err != nil {
log.Println("Error starting server:", err)
return err
}
return nil
}