Commit b499bdea by Torkel Ödegaard

working on panel rendering

parent 3bba8b2c
Subproject commit d584076b93b4ebfb33e5a5f375feb6d6ff7f9bfc
Subproject commit de1de852fc130d6b5c75c28a93aab38bbbe726b8
package api
import "github.com/gin-gonic/gin"
import (
log "github.com/alecthomas/log4go"
"github.com/gin-gonic/gin"
)
func init() {
addRoutes(func(self *HttpServer) {
self.router.GET("/api/render", self.renderToPng)
self.router.GET("/api/render/*url", self.renderToPng)
})
}
func (self *HttpServer) renderToPng(c *gin.Context) {
qs := c.Request.URL.Query()
url := qs["url"][0]
pngPath, err := self.renderer.RenderToPng(url)
url := c.Params.ByName("url")
log.Info("Rendering url %v", url)
pngPath, err := self.renderer.RenderToPng("http://localhost:3000/" + url)
if err != nil {
c.HTML(500, "error.html", nil)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment