* Remove global cache variable. Rather than maintaining cached data in a global variable, instantiate a cache struct and keep it in the `Server` struct. * Store net params in RPC clients. This means net params only need to be supplied once at startup, and also removes a global instance of net params in `background.go`.
19 lines
375 B
Go
19 lines
375 B
Go
// Copyright (c) 2020-2022 The Decred developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package webapi
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func (s *Server) homepage(c *gin.Context) {
|
|
c.HTML(http.StatusOK, "homepage.html", gin.H{
|
|
"WebApiCache": s.cache.getData(),
|
|
"WebApiCfg": s.cfg,
|
|
})
|
|
}
|