Skip to content

Commit

Permalink
Merge pull request #72 from kbss-cvut/139-health-check
Browse files Browse the repository at this point in the history
Add spring actuator health check
  • Loading branch information
blcham authored Oct 2, 2024
2 parents 01887c8 + 6635cfd commit 0a11569
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
8 changes: 6 additions & 2 deletions doc/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

Frontend of the application is developed separately.

The setup requires following steps:
The setup requires the following steps:
1) configure the application according to [Setup Guide](setup.md)
2) configure `config.properties` to contain `security.sameSite=None`
This is important if you are running the application over http so
This is important if you are running the application over HTTP so
web browser would not block requests to the server due to CORS policy.
3) build the backend `mvn clean package`
4) Run the created application archive (`./target/record-manager.jar`)
5) Checkout and run frontend

Alternatively to step 2, a browser plugin can be used to disable CORS policy.

## Health check

To check that the backend is running, use path `/actuator/health` (e.g. `http://localhost:8080/record-manager/actuator/health`).
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>

<!-- Health check -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
server.servlet.context-path=/record-manager
server.servlet.context-path=/record-manager
management.endpoints.web.exposure.include=health

0 comments on commit 0a11569

Please sign in to comment.