diff options
Diffstat (limited to 'src/vendor/github.com/rs/cors/examples/xhandler/server.go')
| -rw-r--r-- | src/vendor/github.com/rs/cors/examples/xhandler/server.go | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/vendor/github.com/rs/cors/examples/xhandler/server.go b/src/vendor/github.com/rs/cors/examples/xhandler/server.go deleted file mode 100644 index 649a1c7..0000000 --- a/src/vendor/github.com/rs/cors/examples/xhandler/server.go +++ /dev/null @@ -1,24 +0,0 @@ -package main - -import ( - "net/http" - - "github.com/rs/cors" - "github.com/rs/xhandler" - "golang.org/x/net/context" -) - -func main() { - c := xhandler.Chain{} - - // Use default options - c.UseC(cors.Default().HandlerC) - - mux := http.NewServeMux() - mux.Handle("/", c.Handler(xhandler.HandlerFuncC(func(ctx context.Context, w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json") - w.Write([]byte("{\"hello\": \"world\"}")) - }))) - - http.ListenAndServe(":8080", mux) -} |
