mirror of
https://github.com/cubixle/tuu.git
synced 2026-04-30 01:08:42 +01:00
SAVEPOINT
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user