Example #1
0
func (c *Index) RSS(ctx *web.Context) string {
	p := PostModelInit()
	results := p.RSS()

	ctx.ContentType("xml")
	return mustache.RenderFile("templates/rss.mustache", map[string][]map[string]string{"posts": results})
}
Example #2
0
func (bs *BlockServer) prepareResponse(c *web.Context) {
	c.ContentType("json")
	c.SetHeader("Modata-NodeID", HexNodeID(bs.contact.ID), true)
	c.SetHeader("Modata-Address", bs.contact.Addr, true)
	c.SetHeader("Modata-Port", fmt.Sprintf("%v", bs.contact.Port), true)
}