From b06a0e2b3db8da1f8165734161247e75963a646a Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sat, 12 Sep 2015 09:52:41 +0100 Subject: [PATCH] Hello --- Caddyfile | 3 +++ hugo.go | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 Caddyfile create mode 100644 hugo.go diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 00000000..79ef6899 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,3 @@ +0.0.0.0 + +hugo diff --git a/hugo.go b/hugo.go new file mode 100644 index 00000000..91d391ee --- /dev/null +++ b/hugo.go @@ -0,0 +1,21 @@ +package hugo + +import ( + "net/http" + + "github.com/mholt/caddy/config/setup" + "github.com/mholt/caddy/middleware" +) + +func Setup(c *setup.Controller) (middleware.Middleware, error) { + return func(next middleware.Handler) middleware.Handler { + return &handler{} + }, nil +} + +type handler struct{} + +func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error) { + w.Write([]byte("Hello, I'm a caddy middleware")) + return 200, nil +}