Skip to content

Commit

Permalink
adds /data/ to path
Browse files Browse the repository at this point in the history
  • Loading branch information
StealWonders committed Feb 3, 2024
1 parent 723ec26 commit c72394a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 3 additions & 3 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ func (cfg *Config) ListenEndpoint() string {

// VersionedPath builds the path string (version + path)
func (cfg *Config) VersionedPath(path string) string {
return "/" + cfg.ServiceVersion + path
return "/data/" + cfg.ServiceVersion + path
}

// SchemaVersionedEndpoint builds the schema endpoint string (schema + host + port + version + path)
func (cfg *Config) SchemaVersionedEndpoint(path string) string {
if cfg.Port == 80 {
return fmt.Sprintf("http://%s/%s%s", cfg.Host, cfg.ServiceVersion, path)
return fmt.Sprintf("http://%s/data/%s%s", cfg.Host, cfg.ServiceVersion, path)
}
return fmt.Sprintf("http://%s:%d/%s%s", cfg.Host, cfg.Port, cfg.ServiceVersion, path)
return fmt.Sprintf("http://%s:%d/data/%s%s", cfg.Host, cfg.Port, cfg.ServiceVersion, path)
}
2 changes: 0 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ func Run(config *Config, client *ent.Client) error {
}

app := gin.Default()

err = app.SetTrustedProxies(nil)
if err != nil {
return err
}

app.Use(cors)

app.Use(sentrygin.New(sentrygin.Options{}))
app.Use(middleware.Auth(middleware.AuthParams{
JWTKeyStore: jwtKeyStore,
Expand Down

0 comments on commit c72394a

Please sign in to comment.