diff options
author | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2016-03-18 18:48:55 +0900 |
---|---|---|
committer | Yasuhiro Matsumoto <mattn.jp@gmail.com> | 2016-03-18 18:48:55 +0900 |
commit | 48865a94526ef82547e225093465763e83bdae46 (patch) | |
tree | edcb79895a32de78b57b476aff33b858b61c690a | |
parent | d829994fc2ceda16489c7de51efb627003e0b3f2 (diff) | |
download | vim-sonictemplate-48865a94526ef82547e225093465763e83bdae46.tar.gz vim-sonictemplate-48865a94526ef82547e225093465763e83bdae46.tar.bz2 vim-sonictemplate-48865a94526ef82547e225093465763e83bdae46.zip |
Add gin-gonic
-rw-r--r-- | template/go/base-web-gin.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/template/go/base-web-gin.go b/template/go/base-web-gin.go new file mode 100644 index 0000000..3ed49b0 --- /dev/null +++ b/template/go/base-web-gin.go @@ -0,0 +1,17 @@ +package main + +import ( + "github.com/gin-gonic/gin" + "github.com/mattn/go-colorable" +) + +func main() { + gin.DefaultWriter = colorable.NewColorableStderr() + r := gin.Default() + r.GET("/", func(c *gin.Context) { + c.JSON(200, gin.H{ + "message": "Hello World", + }) + }) + r.Run() +} |