From 1dc14cc181a80c4dbb94a7957582800f3c992cb8 Mon Sep 17 00:00:00 2001 From: mattn Date: Tue, 7 Oct 2014 20:40:14 +0900 Subject: Add templates for goji framework --- template/go/base-web-goji.go | 17 +++++++++++++++++ template/go/snip-web-goji-get.go | 3 +++ template/go/snip-web-goji-post.go | 3 +++ 3 files changed, 23 insertions(+) create mode 100644 template/go/base-web-goji.go create mode 100644 template/go/snip-web-goji-get.go create mode 100644 template/go/snip-web-goji-post.go diff --git a/template/go/base-web-goji.go b/template/go/base-web-goji.go new file mode 100644 index 0000000..9ed55f1 --- /dev/null +++ b/template/go/base-web-goji.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "net/http" + + "github.com/zenazn/goji" + "github.com/zenazn/goji/web" +) + +func main() { + goji.Get("/", func(c web.C, w http.ResponseWriter, r *http.Request) { + "{{_cursor_}}" + }) + goji.Serve() +} +{{_filter_:web-goji}} diff --git a/template/go/snip-web-goji-get.go b/template/go/snip-web-goji-get.go new file mode 100644 index 0000000..62ea2de --- /dev/null +++ b/template/go/snip-web-goji-get.go @@ -0,0 +1,3 @@ +goji.Get("/", func(c web.C, w http.ResponseWriter, r *http.Request) { + {{_cursor_}} +}) diff --git a/template/go/snip-web-goji-post.go b/template/go/snip-web-goji-post.go new file mode 100644 index 0000000..2060a62 --- /dev/null +++ b/template/go/snip-web-goji-post.go @@ -0,0 +1,3 @@ +goji.Post("/", func(c web.C, w http.ResponseWriter, r *http.Request) { + {{_cursor_}} +}) -- cgit v1.2.3-54-g00ecf