push
circleci
5 of 23 new or added lines in 2 files covered. (21.74%)
3918 of 7320 relevant lines covered (53.52%)
1465.47 hits per line
| 1 |
package main
|
|
| 2 |
|
|
| 3 |
import (
|
|
| 4 |
"fmt"
|
|
| 5 |
|
|
| 6 |
"github.com/jeffotoni/quick"
|
|
| 7 |
) |
|
| 8 |
|
|
| 9 |
// type P struct {
|
|
| 10 |
// Code string `json:"code"`
|
|
| 11 |
// }
|
|
| 12 |
|
|
| 13 |
type Q struct { |
|
| 14 |
Query map[string]string `json:"query"` |
|
| 15 |
} |
|
| 16 |
|
|
|
NEW
|
func main() {
|
× |
|
NEW
|
q := quick.New() |
× |
|
NEW
|
|
× |
|
NEW
|
q.Get("/v1/user", func(c *quick.Ctx) error { |
× |
|
NEW
|
q := c.Query |
× |
|
NEW
|
fmt.Println("query: ", q)
|
× |
|
NEW
|
return c.JSON(Q{
|
× |
|
NEW
|
Query: q, |
× |
|
NEW
|
}) |
× |
|
NEW
|
}) |
× |
| 27 |
|
|
|
NEW
|
q.Post("/v1/user", func(c *quick.Ctx) error { |
× |
|
NEW
|
q := c.Query |
× |
|
NEW
|
fmt.Println("query: ", q)
|
× |
|
NEW
|
return c.JSON(Q{
|
× |
|
NEW
|
Query: q, |
× |
|
NEW
|
}) |
× |
|
NEW
|
}) |
× |
| 35 |
|
|
| 36 |
/// Start the server on port 8080
|
|
|
NEW
|
q.Listen("0.0.0.0:8080")
|
× |
| 38 |
} |