mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-27 01:01:44 +00:00
Upgraded from 99c19923, branch release-3.0. This required fetching or upgrading the following: * k8s.io/api to kubernetes-1.9.1 * k8s.io/apimachinery to kubernetes-1.9.1 * github.com/juju/ratelimit to 1.0.1 * github.com/spf13/pflag to 4c012f6d Also, update Scope's imports/function calls to be compatible with the new client.
24 lines
448 B
Go
24 lines
448 B
Go
package main
|
|
|
|
import (
|
|
"github.com/emicklei/go-restful"
|
|
"io"
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
// This example shows the minimal code needed to get a restful.WebService working.
|
|
//
|
|
// GET http://localhost:8080/hello
|
|
|
|
func main() {
|
|
ws := new(restful.WebService)
|
|
ws.Route(ws.GET("/hello").To(hello))
|
|
restful.Add(ws)
|
|
log.Fatal(http.ListenAndServe(":8080", nil))
|
|
}
|
|
|
|
func hello(req *restful.Request, resp *restful.Response) {
|
|
io.WriteString(resp, "world")
|
|
}
|