chore: update api status

This commit is contained in:
Medzik 2021-09-15 19:31:01 +00:00
parent 7670dee9e9
commit 3af027afdc
3 changed files with 6 additions and 7 deletions

3
.gitignore vendored
View File

@ -14,4 +14,5 @@ dist/
*.test
# Configs
config.toml
*.toml*
!*schema.toml

View File

@ -6,9 +6,7 @@ import (
func ApplyRoutes(r *gin.Engine) {
api := r.Group("/api")
{
api.GET("/url", GetAll)
api.GET("/status", Status)
}
api.GET("/url", GetAll)
api.GET("/status", Status)
}

View File

@ -25,7 +25,7 @@ func Status(c *gin.Context) {
p = json{
"all": ping.Status.Error + ping.Status.Success,
"success": ping.Status.Success,
"err": ping.Status.Error,
"error": ping.Status.Error,
}
} else {
p = nil
@ -37,7 +37,7 @@ func Status(c *gin.Context) {
"uptime": common.Uptime(config.StartTime),
"pid": cpu.PID,
"os": runtime.GOOS,
"mem": json{
"memory": json{
"alloc": mem.Alloc,
"totalalloc": mem.TotalAlloc,
"sys": mem.Sys,