Skip to content

Commit 9a9cc8b

Browse files
authored
Merge pull request #672 from hapifhir/671-update-run-instructions
671 - Updated the run instructions.
2 parents 31e64f6 + 9c4f374 commit 9a9cc8b

File tree

3 files changed

+38
-15
lines changed

3 files changed

+38
-15
lines changed

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -189,21 +189,32 @@ public class YourInterceptor
189189

190190
## Running locally
191191

192-
The easiest way to run this server entirely depends on your environment requirements. At least, the following 4 ways are supported:
192+
The easiest way to run this server entirely depends on your environment requirements. The following ways are supported:
193193

194194
### Using jetty
195195
```bash
196-
mvn -Pjetty jetty:run
196+
mvn -Pjetty spring-boot:run
197197
```
198198

199+
The Server will then be accessible at http://localhost:8080/fhir and the CapabilityStatement will be found at http://localhost:8080/fhir/metadata.
199200

200-
If you need to run this server on a different port (using Maven), you can change the port in the run command as follows:
201-
201+
### Using Spring Boot
202202
```bash
203-
mvn -Pjetty -Djetty.port=8888 jetty:run
203+
mvn spring-boot:run
204+
```
205+
206+
The Server will then be accessible at http://localhost:8080/fhir and the CapabilityStatement will be found at http://localhost:8080/fhir/metadata.
207+
208+
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:
209+
210+
```yaml
211+
server:
212+
# servlet:
213+
# context-path: /example/path
214+
port: 8888
204215
```
205216
206-
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.
217+
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:
207218

208219
```yaml
209220
tester:
@@ -219,7 +230,7 @@ Server will then be accessible at http://localhost:8888/ and eg. http://localhos
219230
```bash
220231
mvn clean spring-boot:run -Pboot
221232
```
222-
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.
233+
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:
223234

224235
```yaml
225236
tester:
@@ -235,7 +246,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
235246
```bash
236247
mvn clean package spring-boot:repackage -Pboot && java -jar target/ROOT.war
237248
```
238-
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.
249+
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:
239250

240251
```yaml
241252
tester:
@@ -250,7 +261,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
250261
```bash
251262
mvn clean package com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=distroless-hapi && docker run -p 8080:8080 distroless-hapi
252263
```
253-
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.
264+
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:
254265

255266
```yaml
256267
tester:
@@ -266,7 +277,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
266277
```bash
267278
./build-docker-image.sh && docker run -p 8080:8080 hapi-fhir/hapi-fhir-jpaserver-starter:latest
268279
```
269-
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.
280+
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:
270281

271282
```yaml
272283
tester:

pom.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,20 @@
596596
</dependency>
597597
</dependencies>
598598
</profile>
599-
<!-- examples of how to start the server using the default profile-->
600-
<!-- mvn clean package jetty:run -->
601-
<!-- java -jar jetty-runner.jar target/hapi-fhir-jpaserver.war -->
599+
<!-- -->
600+
<!-- Examples of how to run the server: -->
601+
<!-- -->
602+
<!-- For Spring Boot use: -->
603+
<!-- mvn spring-boot:run -->
604+
<!-- -->
605+
<!-- For JETTY use: -->
606+
<!-- mvn -Pjetty spring-boot:run -->
607+
<!-- -->
608+
<!-- For the Tomcat WAR approach use: -->
609+
<!-- mvn clean package -DskipTests && java -jar ./target/ROOT.war -->
610+
<!-- -->
611+
<!-- NEXT: Browse to http://localhost:8080/fhir -->
612+
<!-- -->
602613
<profile>
603614
<id>jetty</id>
604615
<dependencies>

src/main/resources/application.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
#Uncomment the following lines to enable the fhir endpoint to be available at /example/path/fhir instead of /fhir
2-
#server:
1+
#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
2+
server:
33
# servlet:
44
# context-path: /example/path
5+
port: 8080
56
#Adds the option to go to eg. http://localhost:8080/actuator/health for seeing the running configuration
67
#see https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints
78
management:

0 commit comments

Comments
 (0)