refactor(global): move config to global package and consolidate handlers
- Move Config struct and related functions to global package - Consolidate handler utilities into utils package - Remove deprecated handlers and instance packages - Add new handlers package with settings and proxy functionality - Update config.json to include watchdog enabled flag
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"super-frpc/postLog"
|
||||
"super-frpc/utils"
|
||||
)
|
||||
|
||||
func GetSettingsHandler(w http.ResponseWriter, r *http.Request) {
|
||||
_, err := utils.Auth(w, r, http.MethodGet, "superuser", "admin")
|
||||
if err != nil {
|
||||
utils.SendErrorResponse(w, http.StatusUnauthorized, err.Error())
|
||||
postLog.Warning(fmt.Sprintf("[GetSettingsHandler] Auth failed: %v", err))
|
||||
return
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user