move outJson build process to backend

This commit is contained in:
Alireza Ahmadi
2025-01-04 21:52:41 +01:00
parent fe428ed412
commit 753d1f9256
8 changed files with 300 additions and 215 deletions
+8
View File
@@ -27,6 +27,14 @@ func getRemoteIp(c *gin.Context) string {
}
}
func getHostname(c *gin.Context) string {
host := c.Request.Host
if colonIndex := strings.LastIndex(host, ":"); colonIndex != -1 {
host, _, _ = net.SplitHostPort(c.Request.Host)
}
return host
}
func jsonMsg(c *gin.Context, msg string, err error) {
jsonMsgObj(c, msg, nil, err)
}