1
0
Fork 0
This commit is contained in:
Alex Myasoedov 2016-02-29 22:01:13 +02:00
parent 6603399d96
commit d70f7d37b2
2 changed files with 5 additions and 2 deletions

View file

@ -25,11 +25,14 @@ func NewApp() *gin.Engine {
if err != nil { if err != nil {
panic(err) panic(err)
} }
ioutil.WriteFile("slides.md", body, 0644)
c.String(200, string(body)) c.String(200, string(body))
}) })
r.PUT("/slides.md", func(c *gin.Context) { 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 return r

View file

@ -14,7 +14,7 @@
<body> <body>
<div id="edit-pane"> <div id="edit-pane">
<div id="controls"> <div id="controls">
<a href="" target="_blank" onclick="save();"> Present</a> <a href="{{ .pubTo}}" target="_blank" onclick="save();"> Present</a>
</div> </div>
<div id="editor"></div> <div id="editor"></div>
</div> </div>