Renames and dots in comments
This commit is contained in:
parent
b0175542f1
commit
1d2ae0e394
@ -19,7 +19,7 @@ func main() {
|
||||
log.Fatalf("Could not load config: %v", err)
|
||||
}
|
||||
|
||||
q, err := postgres.Connect("pgx", cfg.DatabaseConnection)
|
||||
queries, err := postgres.Connect("pgx", cfg.DatabaseConnection)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed connecting to DB: %v", err)
|
||||
}
|
||||
@ -30,7 +30,7 @@ func main() {
|
||||
}
|
||||
|
||||
handler := &server.Handler{
|
||||
Service: q,
|
||||
Service: queries,
|
||||
TokenVerifier: &jwt.TokenVerifier{},
|
||||
CredentialsVerifier: &bcrypt.Verifier{},
|
||||
StaticFS: http.FS(static),
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user