Skip to content

Commit

Permalink
fix: set default configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioromagnollo committed Oct 12, 2023
1 parent 2d5f3a1 commit 44e9287
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KREST_APP_ENV=development
KREST_APP_NAME=kafkarest
KREST_APP_PORT=8888
PORT=8888

# Kafka Config
KREST_KAFKA_HOST=localhost:9092
KAFKA_HOST=localhost:9092
4 changes: 2 additions & 2 deletions .env.test
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KREST_APP_ENV=test
KREST_APP_NAME=kafkarest
KREST_APP_PORT=8889
PORT=8889

# Kafka Config
KREST_KAFKA_HOST=localhost:9092
KAFKA_HOST=localhost:9092
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
dev: ## Run the app in development mode
APP_ENV=development go run cmd/api/main.go
.PHONY: dev
.PHONY: dev

up:
@docker-compose up --build -d
.PHONY: up

stop:
@docker-compose stop
.PHONY: stop
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3'

services:
kafka-rest:
container_name: kafka-rest
image: mauricioromagnollo/kafka-rest:latest
ports:
- "8080:8080"
environment:
- KAFKA_HOST=kafka:29092

# kafka-rest-test:
# container_name: kafka-rest-test
# build:
# context: .
# dockerfile: Dockerfile
# ports:
# - "8082:8080"
# volumes:
# - .:/app
2 changes: 1 addition & 1 deletion external/config/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func NewEnvironment() *Environment {
AppEnv: getEnv("KREST_APP_ENV"),
AppName: "kafka-rest",
AppPort: appPort,
KafkaHost: getEnv("KAFKA_HOST"),
KafkaHost: getEnv("KAFKA_BROKERCONNECT"),
}
}

Expand Down
5 changes: 4 additions & 1 deletion request.http
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ POST http://localhost:8888/publish
"message": {
"foo": "bar"
}
}
}

###
GET http://localhost:8082/status

0 comments on commit 44e9287

Please sign in to comment.