Initial commit
This commit is contained in:
24
examples/kamikaze/main.go
Normal file
24
examples/kamikaze/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import "log"
|
||||
import "net/http"
|
||||
import "crypto/tls"
|
||||
import "hnakra/service"
|
||||
|
||||
func main () {
|
||||
http.HandleFunc("/kamikaze/", hellorld)
|
||||
err := (&service.HTTP { Mount: service.Mount {
|
||||
Path: "/kamikaze/",
|
||||
Name: "Kamikaze",
|
||||
Description: "A service that abrupltly closes upon any request, for testing",
|
||||
TLSConfig: &tls.Config { InsecureSkipVerify: true },
|
||||
}}).Run()
|
||||
|
||||
if err != nil {
|
||||
log.Println("XXX", err)
|
||||
}
|
||||
}
|
||||
|
||||
func hellorld (res http.ResponseWriter, req *http.Request) {
|
||||
log.Fatal("Goodbye!")
|
||||
}
|
||||
Reference in New Issue
Block a user