Skip to content

Commit

Permalink
register event hooks
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Siwiec <[email protected]>
  • Loading branch information
rizzza committed Nov 3, 2023
1 parent 33147ea commit 51ff3a3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (

"go.infratographer.com/location-api/internal/config"
ent "go.infratographer.com/location-api/internal/ent/generated"
"go.infratographer.com/location-api/internal/ent/generated/eventhooks"
"go.infratographer.com/location-api/internal/graphapi"
)

Expand Down Expand Up @@ -113,6 +114,14 @@ func serve(ctx context.Context) error {
client := ent.NewClient(cOpts...)
defer client.Close()

// Run the automatic migration tool to create all schema resources.
if err := client.Schema.Create(ctx); err != nil {
logger.Errorf("failed creating schema resources", zap.Error(err))
return err
}

eventhooks.EventHooks(client)

var middleware []echo.MiddlewareFunc

// jwt auth middleware
Expand Down

0 comments on commit 51ff3a3

Please sign in to comment.