forked from coracle/zooid
Clean up api and blossom
This commit is contained in:
+2
-3
@@ -26,10 +26,9 @@ func main() {
|
||||
}
|
||||
|
||||
// Load config for the specified relay
|
||||
filename := fmt.Sprintf("%s.toml", *relay)
|
||||
config, err := zooid.LoadConfig(filename)
|
||||
config, err := zooid.LoadConfigFromId(*relay)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "No such config file", filename)
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -40,10 +40,9 @@ func main() {
|
||||
}
|
||||
|
||||
// Load config for the specified relay
|
||||
filename := fmt.Sprintf("%s.toml", *relay)
|
||||
config, err := zooid.LoadConfig(filename)
|
||||
config, err := zooid.LoadConfigFromId(*relay)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "No such config file", filename)
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
+2
-4
@@ -21,8 +21,6 @@ func main() {
|
||||
|
||||
port := zooid.Env("PORT")
|
||||
apiHost := zooid.Env("API_HOST")
|
||||
apiWhitelist := zooid.Env("API_WHITELIST")
|
||||
configDir := zooid.Env("CONFIG")
|
||||
pprofAddr := zooid.Env("PPROF_ADDR")
|
||||
|
||||
// pprof server — only starts when PPROF_ADDR is set. Bind to
|
||||
@@ -50,8 +48,8 @@ func main() {
|
||||
|
||||
// Wrap with API handler if API_HOST is configured
|
||||
var handler http.Handler = mainHandler
|
||||
if apiHost != "" && apiWhitelist != "" {
|
||||
apiHandler := zooid.NewAPIHandler(apiWhitelist, configDir)
|
||||
if apiHost != "" {
|
||||
apiHandler := zooid.NewAPIHandler()
|
||||
handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
// Check if this request is for the API host
|
||||
if r.Host == apiHost {
|
||||
|
||||
Reference in New Issue
Block a user