federated-dash/cmd/web/routes.go

17 lines
459 B
Go
Raw Permalink Normal View History

2024-06-25 17:35:30 +00:00
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)
2024-06-25 21:28:39 +00:00
mux.HandleFunc("GET /", app.notFound)
mux.HandleFunc("GET /vpn/{$}", app.vpn)
2024-08-22 19:53:27 +00:00
mux.HandleFunc("GET /apps/{$}", app.appList)
2024-06-25 21:28:39 +00:00
2024-06-25 17:35:30 +00:00
return mux
}