Renames and dots in comments
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed

This commit is contained in:
2022-02-19 22:04:51 +00:00
parent b0175542f1
commit 1d2ae0e394
2 changed files with 6 additions and 5 deletions

View File

@ -15,7 +15,7 @@ import (
"github.com/gin-gonic/gin"
)
// Handler handles incoming requests
// Handler handles incoming requests.
type Handler struct {
Service *postgres.Database
TokenVerifier budgeteer.TokenVerifier
@ -23,7 +23,7 @@ type Handler struct {
StaticFS http.FileSystem
}
// Serve starts the http server
// Serve starts the http server.
func (h *Handler) Serve() {
router := gin.Default()
h.LoadRoutes(router)
@ -33,7 +33,7 @@ func (h *Handler) Serve() {
}
}
// LoadRoutes initializes all the routes
// LoadRoutes initializes all the routes.
func (h *Handler) LoadRoutes(router *gin.Engine) {
router.Use(enableCachingForStaticFiles())
router.NoRoute(h.ServeStatic)
@ -73,6 +73,7 @@ func (h *Handler) LoadRoutes(router *gin.Engine) {
transaction.POST("/new", h.newTransaction)
transaction.POST("/:transactionid", h.newTransaction)
}
func (h *Handler) ServeStatic(c *gin.Context) {
h.ServeStaticFile(c, c.Request.URL.Path)
}