Skip to content

Commit

Permalink
changed port in config
Browse files Browse the repository at this point in the history
  • Loading branch information
andrptrc committed Oct 1, 2024
1 parent 8ad94fa commit 6222311
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
23 changes: 23 additions & 0 deletions ZigZag/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Log level
LOG_LEVEL=debug

# Environment
ENVIRONMENT=development

# The Core engine URLs
ENGINE_URLS=["http://localhost:8080"]

# The Service Port
SERVICE_PORT=9090

# The Service URL+Port
SERVICE_URL="http://localhost:${SERVICE_PORT}"

# The maximum of tasks the service can process
MAX_TASKS=50

# The number of times the service tries to announce itself to the engine
ENGINE_ANNOUNCE_RETRIES=5

# The number of seconds between each retry
ENGINE_ANNOUNCE_RETRY_DELAY=3
8 changes: 4 additions & 4 deletions ZigZag/src/main/java/ch/heia/ZigZag/service/TaskService.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@
@Service
public class TaskService {


// Change this to an env variable instead of hard coding url.
private static final String SERVICE_URL = "https://ps4-2023-grp2.kube.isc.heia-fr.ch/zigzag";
private static final String SERVICE_NAME = "zigzag";
private static final String SERVICE_URL = System.getenv("SERVICE_URL");
private static final String SERVICE_NAME = "zigzag-binarization";
private final BinarizationService binarizationService;
private final StorageService storageService;

Expand Down Expand Up @@ -71,6 +69,8 @@ public class TaskService {
public TaskService(StorageService storageService, BinarizationService binarizationService) {
this.storageService = storageService;
this.binarizationService = binarizationService;
logger.info(SERVICE_NAME + " service started");
logger.info("Service URL: " + SERVICE_URL);
}


Expand Down
7 changes: 4 additions & 3 deletions ZigZag/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
UrlPrefix=${URL_PREFIX:}
# URL_PREFIX is root
UrlPrefix=${URL_PREFIX:/}
server.error.include-message=always
server.port=8081
server.port=80
spring.mvc.static-path-pattern=${UrlPrefix}/**
ServiceUrl=${SERVICE_URL:http://localhost:8081/zigzag}
ServiceUrl=${SERVICE_URL:http://localhost:80}
# Set the OpenApi spec as requested by the iCoServices Documentation
# springdoc.api-docs.path=${URL_PREFIX}/specification

0 comments on commit 6222311

Please sign in to comment.