Skip to content

Commit

Permalink
updated url config
Browse files Browse the repository at this point in the history
  • Loading branch information
supreme2580 committed Jan 27, 2025
1 parent 2abf7b1 commit a8ef880
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
30 changes: 16 additions & 14 deletions backend/config/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion backend/routes/indexer/worlds.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions configs/backend.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion configs/docker-backend.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 2 additions & 1 deletion configs/prod-backend.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit a8ef880

Please sign in to comment.