genofire/hs_monolith
genofire
/
hs_monolith
Archived
1
0
Fork 0
This repository has been archived on 2020-09-27. You can view files and clone it, but cannot push or open issues or pull requests.
hs_monolith/http/status.go

20 lines
541 B
Go
Raw Normal View History

2017-03-25 16:09:17 +01:00
package http
import (
"net/http"
"github.com/genofire/hs_master-kss-monolith/lib/database"
lib "github.com/genofire/hs_master-kss-monolith/lib/http"
logger "github.com/genofire/hs_master-kss-monolith/lib/log"
"github.com/genofire/hs_master-kss-monolith/models"
2017-03-25 16:09:17 +01:00
)
func status(w http.ResponseWriter, r *http.Request) {
log := logger.HTTP(r)
var reviews []*models.Review
var count int64
database.Read.Find(&reviews).Count(&count)
lib.Write(w, map[string]interface{}{"status": "running", "review_count": count})
log.Info("done")
2017-03-25 16:09:17 +01:00
}