federated-dash/cmd/web/routes.go
2024-08-22 13:53:27 -06:00

17 lines
459 B
Go

package main
import "net/http"
func (app *application) routes() *http.ServeMux {
mux := http.NewServeMux()
//Set up static file server
fileServer := http.FileServer(http.Dir("./ui/static"))
mux.Handle("GET /static/", http.StripPrefix("/static", fileServer))
//Set up routes
mux.HandleFunc("GET /{$}", app.home)
mux.HandleFunc("GET /", app.notFound)
mux.HandleFunc("GET /vpn/{$}", app.vpn)
mux.HandleFunc("GET /apps/{$}", app.appList)
return mux
}