SAVEPOINT

This commit is contained in:
luke.rodham
2017-11-10 10:52:11 +00:00
parent a189881568
commit 59301c7622
12 changed files with 455 additions and 7 deletions
+30
View File
@@ -0,0 +1,30 @@
package examples
import (
"log"
"gitlab.com/lrodham/tuu"
)
func main() {
router := tuu.NewRouter()
router.GET("/home", func(ctx tuu.Context) error {
ctx.Set("template_data", "some value")
return ctx.Render(200, render.HTML("template_name.html"))
})
router.POST("/login", func(ctx tuu.Context) error {
username := ctx.Param("username")
password := ctx.Param("password")
log.Println(username, password)
return nil
})
app := tuu.New(router)
if err := app.Serve(); err != nil {
panic(err)
}
}