added from and to times to team view fixes #4, #5

This commit is contained in:
2025-03-27 12:21:58 +01:00
parent d9e0bd7bdf
commit b43783356f
7 changed files with 263 additions and 91 deletions

View File

@@ -4,14 +4,12 @@ import (
"arbeitszeitmessung/endpoints"
"arbeitszeitmessung/helper"
"arbeitszeitmessung/models"
"arbeitszeitmessung/templates"
"context"
"fmt"
"log"
"net/http"
"time"
"github.com/a-h/templ"
"github.com/joho/godotenv"
_ "github.com/lib/pq"
)
@@ -42,13 +40,13 @@ func main() {
server.HandleFunc("/user/login", endpoints.LoginHandler)
server.HandleFunc("/user", endpoints.UserHandler)
server.HandleFunc("/team", endpoints.TeamHandler)
server.Handle("/", templ.Handler(templates.NavPage()))
server.Handle("/", http.RedirectHandler("/time", http.StatusPermanentRedirect))
server.Handle("/static/", http.StripPrefix("/static/", fs))
serverSessionMiddleware := endpoints.Session.LoadAndSave(server)
// starting the http server
fmt.Printf("Server is running at http://localhost:8000 exposed to port %s\n", helper.GetEnv("EXPOSED_PORT", "8000"))
fmt.Printf("Server is running at http://localhost:%s\n", helper.GetEnv("EXPOSED_PORT", "8080"))
log.Fatal(http.ListenAndServe(":8080", serverSessionMiddleware))
}