4
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 {
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

View file

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