Poking around building OCI images on Tangled
1package main
2
3import (
4 "fmt"
5 "net/http"
6 "os"
7)
8
9func main() {
10 fmt.Println("listening on port 3000")
11
12 if err := http.ListenAndServe(
13 "localhost:3000",
14 http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
15 _, err := w.Write([]byte("hello"))
16 if err != nil {
17 fmt.Println("oh no!")
18 }
19 }),
20 ); err != nil {
21 os.Exit(1)
22 }
23}