From ffab04358ac9b359d113b8379fb760c11058bcba Mon Sep 17 00:00:00 2001 From: Kevin Dougan Date: Mon, 1 Apr 2024 15:35:31 -0400 Subject: [PATCH 1/3] 671 - Updated the run instructions. --- pom.xml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index d12cf0e..7f0206f 100644 --- a/pom.xml +++ b/pom.xml @@ -596,9 +596,20 @@ - - - + + + + + + + + + + + + + + jetty From abcb8a904125ecdd9482def77bc417e5ee4376b3 Mon Sep 17 00:00:00 2001 From: Kevin Dougan Date: Tue, 16 Apr 2024 15:56:34 -0400 Subject: [PATCH 2/3] Updated the README file with the new run instructions. --- README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9e617cb..f5adf1b 100644 --- a/README.md +++ b/README.md @@ -189,21 +189,27 @@ public class YourInterceptor ## Running locally -The easiest way to run this server entirely depends on your environment requirements. At least, the following 4 ways are supported: +The easiest way to run this server entirely depends on your environment requirements. The following ways are supported: + +### Using Spring Boot +```bash +mvn spring-boot:run +``` + +The Server will then be accessible at http://localhost:8080/fhir and the CapabilityStatement will be found at http://localhost:8080/fhir/metadata. ### Using jetty ```bash -mvn -Pjetty jetty:run +mvn -Pjetty spring-boot:run ``` - If you need to run this server on a different port (using Maven), you can change the port in the run command as follows: ```bash -mvn -Pjetty -Djetty.port=8888 jetty:run +mvn -Pjetty -Dserver.port=8888 spring-boot:run ``` -Server will then be accessible at http://localhost:8888/ and eg. http://localhost:8888/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg. +The Server will then be accessible at http://localhost:8888/ and eg. http://localhost:8888/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to the following: ```yaml tester: @@ -219,7 +225,7 @@ Server will then be accessible at http://localhost:8888/ and eg. http://localhos ```bash mvn clean spring-boot:run -Pboot ``` -Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg. +Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to the following: ```yaml tester: @@ -235,7 +241,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos ```bash mvn clean package spring-boot:repackage -Pboot && java -jar target/ROOT.war ``` -Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg. +Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following: ```yaml tester: @@ -250,7 +256,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos ```bash mvn clean package com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=distroless-hapi && docker run -p 8080:8080 distroless-hapi ``` -Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg. +Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following: ```yaml tester: @@ -266,7 +272,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos ```bash ./build-docker-image.sh && docker run -p 8080:8080 hapi-fhir/hapi-fhir-jpaserver-starter:latest ``` -Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg. +Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following: ```yaml tester: From 9c4f374964179d79040c9228503d7b64c9aac216 Mon Sep 17 00:00:00 2001 From: Kevin Dougan Date: Fri, 19 Apr 2024 16:00:15 -0400 Subject: [PATCH 3/3] Changed the instructions on how to change the server port. --- README.md | 25 +++++++++++++++---------- src/main/resources/application.yaml | 5 +++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index f5adf1b..71135e8 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,13 @@ public class YourInterceptor The easiest way to run this server entirely depends on your environment requirements. The following ways are supported: +### Using jetty +```bash +mvn -Pjetty spring-boot:run +``` + +The Server will then be accessible at http://localhost:8080/fhir and the CapabilityStatement will be found at http://localhost:8080/fhir/metadata. + ### Using Spring Boot ```bash mvn spring-boot:run @@ -198,18 +205,16 @@ mvn spring-boot:run The Server will then be accessible at http://localhost:8080/fhir and the CapabilityStatement will be found at http://localhost:8080/fhir/metadata. -### Using jetty -```bash -mvn -Pjetty spring-boot:run +If you want to run this server on a different port, you can change the port in the `src/main/resources/application.yaml` file as follows: + +```yaml +server: +# servlet: +# context-path: /example/path + port: 8888 ``` -If you need to run this server on a different port (using Maven), you can change the port in the run command as follows: - -```bash -mvn -Pjetty -Dserver.port=8888 spring-boot:run -``` - -The Server will then be accessible at http://localhost:8888/ and eg. http://localhost:8888/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to the following: +The Server will then be accessible at http://localhost:8888/fhir and the CapabilityStatement will be found at http://localhost:8888/fhir/metadata. Remember to adjust your overlay configuration in the `application.yaml` file to the following: ```yaml tester: diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index e59c338..013c29e 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,7 +1,8 @@ -#Uncomment the following lines to enable the fhir endpoint to be available at /example/path/fhir instead of /fhir -#server: +#Uncomment the "servlet" and "context-path" lines below to make the fhir endpoint available at /example/path/fhir instead of the default value of /fhir +server: # servlet: # context-path: /example/path + port: 8080 #Adds the option to go to eg. http://localhost:8080/actuator/health for seeing the running configuration #see https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints management: