Cosmos-Server/src/configapi/route.go
Yann Stepienik 1ad6edf50a v0.2.0-unstable
new UI
2023-04-28 19:28:01 +01:00

20 lines
493 B
Go

package configapi
import (
"net/http"
"github.com/azukaar/cosmos-server/src/utils"
)
func ConfigRoute(w http.ResponseWriter, req *http.Request) {
if(req.Method == "GET") {
ConfigApiGet(w, req)
} else if (req.Method == "PUT") {
ConfigApiSet(w, req)
} else if (req.Method == "PATCH") {
ConfigApiPatch(w, req)
} else {
utils.Error("UserRoute: Method not allowed" + req.Method, nil)
utils.HTTPError(w, "Method not allowed", http.StatusMethodNotAllowed, "HTTP001")
return
}
}