feat: create-room handler, with middleware
This commit is contained in:
@@ -21,14 +21,16 @@ func RegisterRoutes(sessions sessions.SessionManagement, rooms rooms.RoomManager
|
||||
registerLoginRoutes(&templateFs, sessions, rooms)
|
||||
|
||||
// main page template
|
||||
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
var templFile = "templates/index.gohtml"
|
||||
tmpl := template.Must(template.ParseFS(templateFs, templFile))
|
||||
err := tmpl.Execute(w, nil)
|
||||
if err != nil {
|
||||
log.Printf("my error in executing template, huh\n %s", err)
|
||||
}
|
||||
})
|
||||
http.Handle("/", authedPageMiddleware(
|
||||
sessions,
|
||||
http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
var templFile = "templates/index.gohtml"
|
||||
tmpl := template.Must(template.ParseFS(templateFs, templFile))
|
||||
err := tmpl.Execute(w, nil)
|
||||
if err != nil {
|
||||
log.Printf("my error in executing template, huh\n %s", err)
|
||||
}
|
||||
})))
|
||||
|
||||
// static resources route
|
||||
http.Handle("/static/",
|
||||
|
||||
Reference in New Issue
Block a user