mirror of
https://github.com/yanislav-igonin/micrach
synced 2025-04-19 11:20:33 +03:00
add url of board to request to gateway
This commit is contained in:
parent
a30cf2fbd6
commit
46fd34ebf6
@ -9,4 +9,5 @@ IS_CAPTCHA_ACTIVE=true
|
||||
GATEWAY_URL=http://localhost:3001
|
||||
GATEWAY_API_KEY=example
|
||||
GATEWAY_BOARD_ID=b
|
||||
GATEWAY_BOARD_URL=http://localhost:3000
|
||||
GATEWAY_BOARD_DESCRIPTION=Random
|
@ -11,6 +11,7 @@ type GatewayConfig struct {
|
||||
Url string
|
||||
ApiKey string
|
||||
BoardId string
|
||||
BoardUrl string
|
||||
BoardDescription string
|
||||
}
|
||||
|
||||
@ -59,11 +60,13 @@ func getGatewayConfig() GatewayConfig {
|
||||
apiKey := os.Getenv("GATEWAY_API_KEY")
|
||||
boardId := os.Getenv("GATEWAY_BOARD_ID")
|
||||
description := os.Getenv("GATEWAY_BOARD_DESCRIPTION")
|
||||
boardUrl := os.Getenv("GATEWAY_BOARD_URL")
|
||||
|
||||
return GatewayConfig{
|
||||
Url: url,
|
||||
ApiKey: apiKey,
|
||||
BoardId: boardId,
|
||||
BoardUrl: boardUrl,
|
||||
BoardDescription: description,
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,8 @@ import (
|
||||
func Connect() {
|
||||
requestBody, _ := json.Marshal(map[string]string{
|
||||
"id": Config.App.Gateway.BoardId,
|
||||
"description": Config.App.Gateway.BoardDescription,
|
||||
"name": Config.App.Gateway.BoardDescription,
|
||||
"url": Config.App.Gateway.Url,
|
||||
})
|
||||
url := Config.App.Gateway.Url + "/api/boards"
|
||||
req, err := http.NewRequest("POST", url, bytes.NewBuffer(requestBody))
|
||||
@ -33,4 +34,5 @@ func Connect() {
|
||||
if err != nil {
|
||||
log.Panicln(err)
|
||||
}
|
||||
log.Println("gateway - online")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user