From d70f7d37b205ba27e02e6de82d10ae48d256b0ab Mon Sep 17 00:00:00 2001 From: Alex Myasoedov Date: Mon, 29 Feb 2016 22:01:13 +0200 Subject: [PATCH] Tag --- main.go | 5 ++++- templates/index.tmpl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index d4d38c5..bb443df 100644 --- a/main.go +++ b/main.go @@ -25,11 +25,14 @@ func NewApp() *gin.Engine { if err != nil { panic(err) } + ioutil.WriteFile("slides.md", body, 0644) c.String(200, string(body)) }) r.PUT("/slides.md", func(c *gin.Context) { - c.String(403, "") + body, _ := ioutil.ReadAll(c.Request.Body); + ioutil.WriteFile("slides.md", body, 0644) + c.String(200, "") }) return r diff --git a/templates/index.tmpl b/templates/index.tmpl index b3c2d48..d07e382 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -14,7 +14,7 @@