Cosmos-Server/src/configapi/route.go

20 lines
493 B
Go
Raw Normal View History

2023-03-16 18:56:36 +00:00
package configapi
import (
"net/http"
2023-03-25 20:15:00 +00:00
"github.com/azukaar/cosmos-server/src/utils"
2023-03-16 18:56:36 +00:00
)
func ConfigRoute(w http.ResponseWriter, req *http.Request) {
if(req.Method == "GET") {
ConfigApiGet(w, req)
} else if (req.Method == "PUT") {
ConfigApiSet(w, req)
2023-04-28 18:28:01 +00:00
} else if (req.Method == "PATCH") {
ConfigApiPatch(w, req)
2023-03-16 18:56:36 +00:00
} else {
utils.Error("UserRoute: Method not allowed" + req.Method, nil)
utils.HTTPError(w, "Method not allowed", http.StatusMethodNotAllowed, "HTTP001")
return
}
}