portfolio/web/webRoutes.go

25 lines
618 B
Go
Raw Normal View History

2024-05-16 18:42:31 +02:00
package web
2024-05-16 17:59:21 +02:00
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
}