feat: initial login page
with separate file for future util endpoints, also dummy sessions inteface
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"html/template"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"sunshine.industries/some-automoderation/sessions"
|
||||
)
|
||||
|
||||
//go:embed templates
|
||||
@@ -13,13 +15,15 @@ var templateFs embed.FS
|
||||
//go:embed static
|
||||
var staticFilesFs embed.FS
|
||||
|
||||
func RegisterRoutes() {
|
||||
func RegisterRoutes(sessions *sessions.DummySM) {
|
||||
// login page
|
||||
registerLoginRoutes(&templateFs, sessions)
|
||||
|
||||
// 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, 15)
|
||||
err := tmpl.Execute(w, nil)
|
||||
if err != nil {
|
||||
log.Printf("my error in executing template, huh\n %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user