platform: modularize api/gui, add docs-tests-web foundation, and refresh root config
This commit is contained in:
21
selective-vpn-api/app/traffic_appmarks_handlers.go
Normal file
21
selective-vpn-api/app/traffic_appmarks_handlers.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func handleTrafficAppMarks(w http.ResponseWriter, r *http.Request) {
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
vpnCount, directCount := appMarksGetStatus()
|
||||
writeJSON(w, http.StatusOK, TrafficAppMarksStatusResponse{
|
||||
VPNCount: vpnCount,
|
||||
DirectCount: directCount,
|
||||
Message: "ok",
|
||||
})
|
||||
case http.MethodPost:
|
||||
handleTrafficAppMarksPost(w, r)
|
||||
default:
|
||||
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user