1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-19 19:07:06 +00:00

new simple _examples/README.md, wiki should live only inside kataras/iris/wiki and the provided e-book

Former-commit-id: 350eafb0f70f8433e394e103ff93fa332ee00a05
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-05-05 16:03:19 +03:00
parent f5e59c10e1
commit c10dd32ad7
28 changed files with 416 additions and 1166 deletions

View File

@@ -0,0 +1,17 @@
package routes
import (
"fmt"
"github.com/kataras/iris/v12/sessions"
)
// Index will increment a simple int version based on the visits that this user/session did.
func Index(session *sessions.Session) string {
// it increments a "visits" value of integer by one,
// if the entry with key 'visits' doesn't exist it will create it for you.
visits := session.Increment("visits", 1)
// write the current, updated visits.
return fmt.Sprintf("%d visit(s) from my current session", visits)
}