adds ability to set an env in the app context

This commit is contained in:
2018-01-04 07:32:15 +00:00
parent 95400f4e69
commit 2d05e42555
7 changed files with 26 additions and 11 deletions
+6 -2
View File
@@ -9,7 +9,7 @@ import (
func main() {
router := tuu.NewRouter()
router.SetEnv("dev")
router.GET("/home", func(ctx tuu.Context) error {
ctx.Set("template_data", "some value")
@@ -26,7 +26,11 @@ func main() {
})
app := tuu.New(router)
if err := app.Serve(); err != nil {
if err := app.Serve(tuu.Config{
IPAddr: "127.0.0.1",
Port: "8080",
Env: "dev",
}); err != nil {
panic(err)
}
}