2023-05-25 16:08:56 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "log"
|
|
|
|
import "net/http"
|
|
|
|
import "hnakra/service"
|
|
|
|
|
|
|
|
func main () {
|
|
|
|
http.HandleFunc("/hello/", hellorld)
|
2023-05-27 01:57:27 -06:00
|
|
|
err := service.NewHTTP("Hellorld", "A test service.", "@", "/hello/").Run()
|
2023-05-25 16:08:56 -06:00
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
log.Println("XXX", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func hellorld (res http.ResponseWriter, req *http.Request) {
|
|
|
|
res.Header().Add("content-type", "text/plain")
|
|
|
|
res.WriteHeader(200)
|
|
|
|
res.Write([]byte("Hellorld!\n"))
|
|
|
|
}
|