Skip to content

Commit

Permalink
Merge pull request hapifhir#672 from hapifhir/671-update-run-instruct…
Browse files Browse the repository at this point in the history
…ions

671 - Updated the run instructions.
  • Loading branch information
dotasek committed Apr 23, 2024
2 parents 31e64f6 + 9c4f374 commit 9a9cc8b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,32 @@ 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 jetty
```bash
mvn -Pjetty jetty:run
mvn -Pjetty spring-boot:run
```

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

If you need to run this server on a different port (using Maven), you can change the port in the run command as follows:

### Using Spring Boot
```bash
mvn -Pjetty -Djetty.port=8888 jetty:run
mvn spring-boot:run
```

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

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
```

Server will then be accessible at http:https://localhost:8888/ and eg. http:https://localhost:8888/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg.
The Server will then be accessible at http:https://localhost:8888/fhir and the CapabilityStatement will be found at http:https://localhost:8888/fhir/metadata. Remember to adjust your overlay configuration in the `application.yaml` file to the following:

```yaml
tester:
Expand All @@ -219,7 +230,7 @@ Server will then be accessible at http:https://localhost:8888/ and eg. http:https://localhos
```bash
mvn clean spring-boot:run -Pboot
```
Server will then be accessible at http:https://localhost:8080/ and eg. http:https://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg.
Server will then be accessible at http:https://localhost:8080/ and eg. http:https://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to the following:

```yaml
tester:
Expand All @@ -235,7 +246,7 @@ Server will then be accessible at http:https://localhost:8080/ and eg. http:https://localhos
```bash
mvn clean package spring-boot:repackage -Pboot && java -jar target/ROOT.war
```
Server will then be accessible at http:https://localhost:8080/ and eg. http:https://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg.
Server will then be accessible at http:https://localhost:8080/ and eg. http:https://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:

```yaml
tester:
Expand All @@ -250,7 +261,7 @@ Server will then be accessible at http:https://localhost:8080/ and eg. http:https://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:https://localhost:8080/ and eg. http:https://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg.
Server will then be accessible at http:https://localhost:8080/ and eg. http:https://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:

```yaml
tester:
Expand All @@ -266,7 +277,7 @@ Server will then be accessible at http:https://localhost:8080/ and eg. http:https://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:https://localhost:8080/ and eg. http:https://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to eg.
Server will then be accessible at http:https://localhost:8080/ and eg. http:https://localhost:8080/fhir/metadata. Remember to adjust your overlay configuration in the application.yaml to the following:

```yaml
tester:
Expand Down
17 changes: 14 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,20 @@
</dependency>
</dependencies>
</profile>
<!-- examples of how to start the server using the default profile-->
<!-- mvn clean package jetty:run -->
<!-- java -jar jetty-runner.jar target/hapi-fhir-jpaserver.war -->
<!-- -->
<!-- Examples of how to run the server: -->
<!-- -->
<!-- For Spring Boot use: -->
<!-- mvn spring-boot:run -->
<!-- -->
<!-- For JETTY use: -->
<!-- mvn -Pjetty spring-boot:run -->
<!-- -->
<!-- For the Tomcat WAR approach use: -->
<!-- mvn clean package -DskipTests && java -jar ./target/ROOT.war -->
<!-- -->
<!-- NEXT: Browse to http:https://localhost:8080/fhir -->
<!-- -->
<profile>
<id>jetty</id>
<dependencies>
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -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:https://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:
Expand Down

0 comments on commit 9a9cc8b

Please sign in to comment.