portfolio/web/webRoutes.go
Darius klein 5e1cd15c07
All checks were successful
build and deploy portfolio / build (pull_request) Successful in 51s
build and deploy portfolio / publish-docs (pull_request) Successful in 4s
build and deploy portfolio / publish-portfolio (pull_request) Successful in 3s
Version bump + migration dependencies
2025-05-07 22:33:21 +02:00

25 lines
699 B
Go

package web
import (
"log"
"net/http"
"portfolio/web/handlers"
)
func Routes() *http.ServeMux {
log.Println("Setup web routes")
// 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("/", handlers.HomePageHandler)
mux.HandleFunc("/projects", handlers.ProjectPageHandler)
mux.HandleFunc("/projects/edit", handlers.CreateProjectEditBody)
mux.HandleFunc("/about", handlers.AboutPageHandler)
mux.HandleFunc("/login", handlers.LoginPageHandler)
mux.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir("./web/assets"))))
return mux
}