diff --git a/README.md b/README.md index 5e6c077..2f9d82a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A template project to create a Docker image for a Java application. The [example application](src/main/java/com/miguno/javadockerbuild/App.java) uses Spring Boot to expose an HTTP endpoint at -[`/status`](http://localhost:8123/status). +[`/welcome`](http://localhost:8123/welcome). > **Golang developer?** Check out https://github.com/miguno/golang-docker-build-tutorial @@ -93,7 +93,7 @@ $ docker run -p 8123:8123 miguno/java-docker-build-tutorial:latest ``` Running container from docker image ... Starting container for image 'miguno/java-docker-build-tutorial:latest', exposing port 8123/tcp -- Run 'curl http://localhost:8123/status' to send a test request to the containerized app. +- Run 'curl http://localhost:8123/welcome' to send a test request to the containerized app. - Enter Ctrl-C to stop the container. . ____ _ __ _ _ @@ -123,8 +123,8 @@ Starting container for image 'miguno/java-docker-build-tutorial:latest', exposin running container. ```shell -$ curl http://localhost:8123/status -{"status":"idle"} +$ curl http://localhost:8123/welcome +{"welcome":"Hello, World!"} ``` # Local usage without Docker diff --git a/justfile b/justfile index 2ed3b92..39628ef 100644 --- a/justfile +++ b/justfile @@ -33,13 +33,13 @@ audit: # benchmark the app's HTTP endpoint with plow (requires https://github.com/six-ddc/plow) benchmark-plow: - @echo plow -c 100 --duration=30s http://localhost:${APP_PORT}/status - @plow -c 100 --duration=30s http://localhost:${APP_PORT}/status + @echo plow -c 100 --duration=30s http://localhost:${APP_PORT}/welcome + @plow -c 100 --duration=30s http://localhost:${APP_PORT}/welcome # benchmark the app's HTTP endpoint with wrk (requires https://github.com/wg/wrk) benchmark-wrk: - @echo wrk -t 10 -c 100 --latency --duration 30 http://localhost:${APP_PORT}/status - @wrk -t 10 -c 100 --latency --duration 30 http://localhost:${APP_PORT}/status + @echo wrk -t 10 -c 100 --latency --duration 30 http://localhost:${APP_PORT}/welcome + @wrk -t 10 -c 100 --latency --duration 30 http://localhost:${APP_PORT}/welcome # alias for 'compile' build: compile @@ -135,8 +135,8 @@ site: compile # send request to the app's HTTP endpoint (requires Docker and running app container) send-request-to-app: - @echo curl http://localhost:${APP_PORT}/status - @curl http://localhost:${APP_PORT}/status + @echo curl http://localhost:${APP_PORT}/welcome + @curl http://localhost:${APP_PORT}/welcome # static code analysis with spotbugs spotbugs: compile diff --git a/src/main/java/com/miguno/javadockerbuild/admin/SecuritySecureConfig.java b/src/main/java/com/miguno/javadockerbuild/admin/SecuritySecureConfig.java index 3eed185..aba39ca 100644 --- a/src/main/java/com/miguno/javadockerbuild/admin/SecuritySecureConfig.java +++ b/src/main/java/com/miguno/javadockerbuild/admin/SecuritySecureConfig.java @@ -93,8 +93,8 @@ protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception { //// For the Spring Boot Admin client (the "real" app being developed). .requestMatchers( new AntPathRequestMatcher("/"), - // Permit public access to this app's example endpoint at `/status`. - new AntPathRequestMatcher("/status"), + // Permit public access to this app's example endpoint at `/welcome`. + new AntPathRequestMatcher("/welcome"), // Permit public access to Swagger. new AntPathRequestMatcher("/swagger-ui.html"), new AntPathRequestMatcher("/v3/api-docs"), diff --git a/src/main/java/com/miguno/javadockerbuild/controllers/RootController.java b/src/main/java/com/miguno/javadockerbuild/controllers/RootController.java index e2ac7c7..f99b8c5 100644 --- a/src/main/java/com/miguno/javadockerbuild/controllers/RootController.java +++ b/src/main/java/com/miguno/javadockerbuild/controllers/RootController.java @@ -39,7 +39,7 @@ public String root() {

Enjoy playing around with this application!

Example Endpoints