clustvirt/router/server/root.go
Matthew Stobbs ed9acb7e10 clusterinfo is not htmx enabled
- modified host menu to include the cluster view
- whole site now works via htmx
- about page is still static
2024-03-23 11:34:50 -06:00

22 lines
561 B
Go

package server
import (
"net/http"
"git.staur.ca/stobbsm/clustvirt/view/layouts"
"git.staur.ca/stobbsm/clustvirt/view/static"
"github.com/a-h/templ"
)
// Root based routes for ClustVirt
func (s *Server) baseRoutes() {
// fileserver for static content
fs := http.StripPrefix("/static", http.FileServer(http.Dir("public")))
s.r.Get("/static/*", fs.ServeHTTP)
// Root defaults to the cluster view
s.r.Get("/", templ.Handler(layouts.Manager("ClustVirt", "libvirt made simple")).ServeHTTP)
s.r.Get("/about", templ.Handler(static.About()).ServeHTTP)
}