made session, flash, work(ish)

This commit is contained in:
2018-04-07 19:56:42 +01:00
parent b8f8c995c1
commit 98fad75b95
6 changed files with 41 additions and 37 deletions

18
tuu.go
View File

@@ -9,26 +9,16 @@ import (
"os/signal"
"github.com/gorilla/mux"
"github.com/gorilla/sessions"
)
type Config struct {
IPAddr string
Port string
Env string
SessionName string
SessionStore sessions.Store
IPAddr string
Port string
Env string
}
func New(r Router, cfg Config) *App {
cfg.SessionName = "_tuu_session"
// TODO: make session secret actual, secret.
cfg.SessionStore = sessions.NewCookieStore([]byte("secret"))
app := &App{router: r, cfg: cfg}
r.SetApp(app)
return app
return &App{router: r, cfg: cfg}
}
type App struct {