github.com/tuingking/flamingo@v0.0.0-20220403134817-2796ae0e84ca/handler/rest/home.go (about)

     1  package rest
     2  
     3  import (
     4  	"net/http"
     5  	"runtime"
     6  )
     7  
     8  func (h *RestHandler) Home(w http.ResponseWriter, r *http.Request) {
     9  	data := map[string]interface{}{
    10  		"title": "Home",
    11  		"stat": map[string]interface{}{
    12  			"cpu":       runtime.NumCPU(),
    13  			"goroutine": runtime.NumGoroutine(),
    14  		},
    15  	}
    16  
    17  	h.tpl.ExecuteTemplate(w, "index.html", data)
    18  }