portfolio/web/webRoutes.go
2024-05-16 18:42:31 +02:00

25 lines
618 B
Go

package web
import (
"net/http"
"portfolio/web/handlers"
)
func WebRoutes() *http.ServeMux {
// Create a new request multiplexer
// Take incoming requests and dispatch them to the matching webHandler
mux := http.NewServeMux()
// Register the routes and webHandler
mux.HandleFunc("GET /{$}", handlers.InitHomepage)
mux.HandleFunc("GET /projecten/{$}", handlers.InitProjectpage)
mux.HandleFunc("GET /about/{$}", handlers.InitAboutpage)
mux.HandleFunc("GET /login/{$}", handlers.InitLoginpage)
mux.HandleFunc("POST /theme", handlers.UpdateTheme)
mux.HandleFunc("GET /test", handlers.Test)
return mux
}