Skip to content

Commit

Permalink
feat(backend): Update backend to v4.2.2 (#275)
Browse files Browse the repository at this point in the history
* feat(backend): Update backend to v4.2.2

* fixup! feat(backend): Update backend to v4.2.2

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Morre <[email protected]>
  • Loading branch information
renovate[bot] and morremeyer authored Jan 12, 2024
1 parent 948377f commit 7dec178
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ builds:
- amd64
- arm64
ldflags:
- -X github.com/envelope-zero/backend/pkg/router.version=4.1.0
- -X github.com/envelope-zero/backend/pkg/router.version=4.2.2

snapshot:
name_template: "{{ incpatch .Version }}-next"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ frontend:
VERSION ?= $(shell git rev-parse HEAD)
.PHONY: build
build:
go build -ldflags "-X github.com/envelope-zero/backend/pkg/router.version=4.1.0"
go build -ldflags "-X github.com/envelope-zero/backend/pkg/router.version=4.2.2"
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.19

require (
github.com/adrg/xdg v0.4.0
github.com/envelope-zero/backend/v4 v4.1.0
github.com/envelope-zero/backend/v4 v4.2.2
github.com/gin-contrib/static v0.0.1
github.com/rs/zerolog v1.31.0
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
Expand Down Expand Up @@ -64,7 +64,7 @@ require (
github.com/wei840222/gorm-zerolog v0.0.0-20210303025759-235c42bb33fa // indirect
golang.org/x/arch v0.6.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
golang.org/x/exp v0.0.0-20240110193028-0dcbfd608b1e // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/envelope-zero/backend/v4 v4.1.0 h1:IPeuAEWuSlcf0a65yCRhiOPKTwmPqalkOyvPy/kW9rM=
github.com/envelope-zero/backend/v4 v4.1.0/go.mod h1:F9ZicXHKFFLn6dkkL7LK8lQ5h9M942pJoC+uC0qoulQ=
github.com/envelope-zero/backend/v4 v4.2.2 h1:4RETMjJtxyxm/hXpinn5e5O1WfYojmc03EeK6n8sXCc=
github.com/envelope-zero/backend/v4 v4.2.2/go.mod h1:EykWL1+df+KS4NE3ft5SnZ0DHwW0I+INR+tZRz14Lk8=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/gin-contrib/cors v1.5.0 h1:DgGKV7DDoOn36DFkNtbHrjoRiT5ExCe+PC9/xp7aKvk=
Expand Down Expand Up @@ -210,8 +210,8 @@ golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4=
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/exp v0.0.0-20240110193028-0dcbfd608b1e h1:723BNChdd0c2Wk6WOE320qGBiPtYx0F0Bbm1kriShfE=
golang.org/x/exp v0.0.0-20240110193028-0dcbfd608b1e/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
Expand Down
16 changes: 2 additions & 14 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import (
"time"

"github.com/adrg/xdg"
"github.com/envelope-zero/backend/v4/pkg/controllers"
"github.com/envelope-zero/backend/v4/pkg/database"
"github.com/envelope-zero/backend/v4/pkg/models"
"github.com/envelope-zero/backend/v4/pkg/router"
"github.com/gin-contrib/static"
Expand Down Expand Up @@ -60,31 +58,21 @@ func main() {

dbConnectionOptions := "_pragma=foreign_keys(1)"

db, err := database.Connect(fmt.Sprintf("%s?%s", dbPath, dbConnectionOptions))
if err != nil {
log.Fatal().Msg(err.Error())
}

err = models.Migrate(db)
err = models.Connect(fmt.Sprintf("%s?%s", dbPath, dbConnectionOptions))
if err != nil {
log.Fatal().Msg(err.Error())
}

url, _ := url.Parse("http://localhost:3200/api")

// Set the DB context and add it to the controller
ctx := context.Background()
ctx = context.WithValue(ctx, database.ContextURL, url)
controller := controllers.Controller{DB: db.WithContext(ctx)}

r, teardown, err := router.Config(url)
if err != nil {
log.Fatal().Msg(err.Error())
}
defer teardown()

// Attach all backend routes to /api
router.AttachRoutes(controller, r.Group("/api/"))
router.AttachRoutes(r.Group("/api/"))

// Serve the frontend on /
r.Use(static.Serve("/", EmbedFolder(server, "public")))
Expand Down

0 comments on commit 7dec178

Please sign in to comment.