Skip to content

Commit

Permalink
fix: using relative path to read conf (apache#617)
Browse files Browse the repository at this point in the history
* fix: using  relative path

* fix path

* fix path
  • Loading branch information
nic-chen authored and johzchen committed Oct 29, 2020
1 parent d5077e9 commit 6667e4f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions api/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,19 @@ func setEnvironment() {
}

func configurationPath() string {
if ENV == EnvLOCAL {
if confPath := os.Getenv("APISIX_CONF_PATH"); confPath != "" {
return filepath.Join(confPath, "/conf.json")
} else if ENV == EnvLOCAL {
return filepath.Join(filepath.Dir(basePath), "conf.json")
} else {
return confPath
}
}

func getSchemaPath() string {
if ENV == EnvLOCAL {
if confPath := os.Getenv("APISIX_CONF_PATH"); confPath != "" {
return filepath.Join(confPath, "/schema.json")
} else if ENV == EnvLOCAL {
return filepath.Join(filepath.Dir(basePath), "schema.json")
} else {
return schemaPath
Expand Down

0 comments on commit 6667e4f

Please sign in to comment.