gui prints output from an http get to a configured URL
This commit is contained in:
15
src/testdata/http.go
vendored
Normal file
15
src/testdata/http.go
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
p := os.Getenv("PORT")
|
||||
if err := http.ListenAndServe(":"+p, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Write([]byte(os.Getenv("BODY")))
|
||||
})); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user