package routes import ( "byom-infra-api/handlers" "byom-infra-api/middleware" "github.com/gorilla/mux" ) // SetupRoutes configures all the routes for the application func SetupRoutes(r *mux.Router, dnshandler *handlers.DNSHandler) { // Add logging middleware r.Use(middleware.LoggingMiddleware) // SSH Key routes r.HandleFunc("/sshkey", GetSSHKeys).Methods("GET") r.HandleFunc("/sshkey/{id}", GetSSHKeyByID).Methods("GET") r.HandleFunc("/sshkey", CreateSSHKey).Methods("POST") r.HandleFunc("/sshkey/{id}", DeleteSSHKey).Methods("DELETE") // DNS routes r.HandleFunc("/dns", dnshandler.ListDNSRecords).Methods("GET") r.HandleFunc("/dns/{subdomain}", dnshandler.GetDNSRecordID).Methods("GET") r.HandleFunc("/dns", dnshandler.CreateDNSRecord).Methods("POST") r.HandleFunc("/dns/{id}", dnshandler.DeleteDNSRecord).Methods("DELETE") }