mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-04 18:31:41 +00:00
feature/implement wss routes (#1196)
* feat(database): create schema for hway and motr * fix(gateway): correct naming inconsistencies in handlers * build: update schema file to be compatible with postgresql syntax * fix: update schema to be compatible with PostgreSQL syntax * chore: update query_hway.sql to follow sqlc syntax * ```text refactor: update query_hway.sql for PostgreSQL and sqlc ``` * feat: add vaults table to store encrypted data * refactor: Update vaults table schema for sqlc compatibility * chore(deps): Upgrade dependencies and add pgx/v5 * refactor(Makefile): move sqlc generate to internal/models * docs(foundations): remove outdated pages * chore(build): add Taskfile for build tasks * refactor(embed): move embed files to internal package * docs: add documentation for Cosmos SDK ORM
This commit is contained in:
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/labstack/echo/v4"
|
||||
echomiddleware "github.com/labstack/echo/v4/middleware"
|
||||
config "github.com/onsonr/sonr/internal/config/hway"
|
||||
"github.com/onsonr/sonr/internal/database"
|
||||
"github.com/onsonr/sonr/internal/models/drivers/hwayorm"
|
||||
"github.com/onsonr/sonr/pkg/common"
|
||||
"github.com/onsonr/sonr/pkg/gateway/middleware"
|
||||
"github.com/onsonr/sonr/pkg/gateway/routes"
|
||||
@@ -15,11 +15,8 @@ import (
|
||||
type Gateway = *echo.Echo
|
||||
|
||||
// New returns a new Gateway instance
|
||||
func New(env config.Hway, ipc common.IPFS) (Gateway, error) {
|
||||
db, err := database.NewDB(env)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
func New(env config.Hway, ipc common.IPFS, dbq *hwayorm.Queries) (Gateway, error) {
|
||||
|
||||
e := echo.New()
|
||||
// Override default behaviors
|
||||
e.IPExtractor = echo.ExtractIPDirect()
|
||||
@@ -29,7 +26,7 @@ func New(env config.Hway, ipc common.IPFS) (Gateway, error) {
|
||||
e.Use(echoprometheus.NewMiddleware("hway"))
|
||||
e.Use(echomiddleware.Logger())
|
||||
e.Use(echomiddleware.Recover())
|
||||
e.Use(middleware.UseGateway(env, ipc, db))
|
||||
e.Use(middleware.UseGateway(env, ipc, dbq))
|
||||
routes.Register(e)
|
||||
return e, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user