Esempio n. 1
0
File: main.go Progetto: rajjan/qstn
func entriesNew(c *app.Context) {
	s, entry := api.EntryPost(c)

	if s != 201 {
		c.Error(s)
		return
	}

	c.JSON(entry)
}
Esempio n. 2
0
File: main.go Progetto: rajjan/qstn
func entriesRandom(c *app.Context) {
	s, entry := api.EntryRand(c)

	if s != 200 {
		c.Error(s)
		return
	}

	c.JSON(entry)
}
Esempio n. 3
0
File: main.go Progetto: rajjan/qstn
func entriesGet(c *app.Context) {
	id := c.Seg(2)

	s, entry := api.EntryGet(c, id)

	if s != 200 {
		c.Error(s)
		return
	}

	c.JSON(entry)
}