hnakra/examples/hellorld/main.go
2023-05-29 21:22:46 -04:00

18 lines
381 B
Go

package main
import "net/http"
import "hnakra/service"
func main () {
http.HandleFunc("/hello/", hellorld)
service.NewService (
"Hellorld", "A test service.",
service.NewHTTP("@", "/hello/", nil)).Run()
}
func hellorld (res http.ResponseWriter, req *http.Request) {
res.Header().Add("content-type", "text/plain")
res.WriteHeader(200)
res.Write([]byte("Hellorld!\n"))
}