From a8ef88007a40619ab81b4449170abdd48cce952f Mon Sep 17 00:00:00 2001 From: Supreme2580 Date: Mon, 27 Jan 2025 17:53:49 +0100 Subject: [PATCH] updated url config --- backend/config/backend.go | 30 ++++++++++++++++-------------- backend/routes/indexer/worlds.go | 2 +- configs/backend.config.json | 1 + configs/docker-backend.config.json | 3 ++- configs/prod-backend.config.json | 3 ++- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/backend/config/backend.go b/backend/config/backend.go index 7a858016..6099f33e 100644 --- a/backend/config/backend.go +++ b/backend/config/backend.go @@ -44,23 +44,25 @@ type HttpConfig struct { } type BackendConfig struct { - Host string `json:"host"` - Port int `json:"port"` - ConsumerPort int `json:"consumer_port"` - WsHost string `json:"ws_host"` - WsPort int `json:"ws_port"` - Scripts BackendScriptsConfig `json:"scripts"` - Production bool `json:"production"` - WebSocket WebSocketConfig `json:"websocket"` - Http HttpConfig `json:"http_config"` + Host string `json:"host"` + Port int `json:"port"` + ConsumerPort int `json:"consumer_port"` + WsHost string `json:"ws_host"` + WsPort int `json:"ws_port"` + AchievementBotUrl string `json:"achievement_bot_url"` + Scripts BackendScriptsConfig `json:"scripts"` + Production bool `json:"production"` + WebSocket WebSocketConfig `json:"websocket"` + Http HttpConfig `json:"http_config"` } var DefaultBackendConfig = BackendConfig{ - Host: "localhost", - Port: 8080, - ConsumerPort: 8081, - WsHost: "localhost", - WsPort: 8083, + Host: "localhost", + Port: 8080, + ConsumerPort: 8081, + WsHost: "localhost", + WsPort: 8083, + AchievementBotUrl: "http://localhost:3001/Art%20Peace%20Achievement%20Bot/message", Scripts: BackendScriptsConfig{ PlacePixelDevnet: "../scripts/place_pixel.sh", PlaceExtraPixelsDevnet: "../scripts/place_extra_pixels.sh", diff --git a/backend/routes/indexer/worlds.go b/backend/routes/indexer/worlds.go index bdd8c868..a0c1eee2 100644 --- a/backend/routes/indexer/worlds.go +++ b/backend/routes/indexer/worlds.go @@ -410,7 +410,7 @@ func processCanvasPixelPlacedEvent(event IndexerEvent) { // Send milestone notification _, err = http.Post( - "http://localhost:3001/Art%20Peace%20Achievement%20Bot/message", + core.ArtPeaceBackend.BackendConfig.AchievementBotUrl, "application/json", strings.NewReader(fmt.Sprintf(`{ "userId": "user", diff --git a/configs/backend.config.json b/configs/backend.config.json index aef484d0..55b077e2 100644 --- a/configs/backend.config.json +++ b/configs/backend.config.json @@ -4,6 +4,7 @@ "consumer_port": 8081, "ws_host": "localhost", "ws_port": 8083, + "achievement_bot_url": "http://localhost:3001/Art%20Peace%20Achievement%20Bot/message", "scripts": { "place_pixel_devnet": "../tests/integration/local/place_pixel.sh", "place_extra_pixels_devnet": "../tests/integration/local/place_extra_pixels.sh", diff --git a/configs/docker-backend.config.json b/configs/docker-backend.config.json index 4ce67945..ad94ba3a 100644 --- a/configs/docker-backend.config.json +++ b/configs/docker-backend.config.json @@ -39,5 +39,6 @@ "allow_origin": ["*"], "allow_methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"], "allow_headers": ["Content-Type"] - } + }, + "achievement_bot_url": "http://achievement-bot:3001/Art%20Peace%20Achievement%20Bot/message" } diff --git a/configs/prod-backend.config.json b/configs/prod-backend.config.json index e22b2f8d..da62442d 100644 --- a/configs/prod-backend.config.json +++ b/configs/prod-backend.config.json @@ -24,5 +24,6 @@ "allow_origin": ["*"], "allow_methods": ["GET", "POST", "PUT", "DELETE", "OPTIONS"], "allow_headers": ["Content-Type"] - } + }, + "achievement_bot_url": "https://achievement-bot.art-peace.net/Art%20Peace%20Achievement%20Bot/message" }