Files
zeekay 285bb5a76b rename: ziti → zt across all paths
- Repo names: ziti-* → zt-*
- Go modules: github.com/hanzozt/ziti → github.com/hanzozt/zt
- Docker images: hanzozt/ziti-* → hanzozt/zt-*
- C/Java/JS symbols: ziti_* → zt_*
- File and directory names updated
2026-02-18 18:34:10 -08:00

29 lines
566 B
Go

package main
import (
"fmt"
"net/http"
"os"
"strconv"
)
func main() {
http.HandleFunc("/hello", hello)
http.HandleFunc("/add", add)
if err := http.ListenAndServe(":8090", nil); err != nil {
panic(err)
}
}
func hello(w http.ResponseWriter, req *http.Request) {
host, _ := os.Hostname()
_, _ = fmt.Fprintf(w, "ztfied hello from %s", host)
}
func add(w http.ResponseWriter, req *http.Request) {
a, _ := strconv.Atoi(req.URL.Query().Get("a"))
b, _ := strconv.Atoi(req.URL.Query().Get("b"))
c := a + b
_, _ = fmt.Fprintf(w, "a+b=%d+%d=%d", a, b, c)
}