| Conditions | 4 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package main |
||
| 11 | func main() { |
||
| 12 | e := echo.New() |
||
| 13 | component := views.Page("John") |
||
| 14 | |||
| 15 | clickedComponent := views.Clicked() |
||
| 16 | |||
| 17 | e.Static("/", "static") |
||
| 18 | |||
| 19 | e.GET("/", func(c echo.Context) error { |
||
| 20 | err := component.Render(c.Request().Context(), c.Response()) |
||
| 21 | if err != nil { |
||
| 22 | return err |
||
| 23 | } |
||
| 24 | return nil |
||
| 25 | }) |
||
| 26 | |||
| 27 | e.POST("/clicked", func(c echo.Context) error { |
||
| 28 | return Render(c, http.StatusOK, clickedComponent) |
||
| 29 | }) |
||
| 30 | |||
| 31 | e.Logger.Fatal(e.Start(":3000")) |
||
| 32 | } |
||
| 38 |