diff --git a/README.md b/README.md index 9093590d05bd10a9eae0240351c6c4155825a674..1fd8092f87711dcd74674540a631fc0b3ca2382c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,82 @@ # HelloREST +> **_INFO:_** Demo project for Spring Boot and REST + +## Table of Contents +1. [Run Application (MAVEN)](#run-application-maven) +2. [Run Application (DOCKER)](#run-application-docker) +3. [How to use Application](#how-to-use-application) + +## Run Application (MAVEN) +Clone Repository: +```sh +git clone https://transfer.hft-stuttgart.de/gitlab/kebidge/hello-rest.git +``` +Build Application: +```sh +mvn clean package +``` +Run Spring-Boot Application: +```sh +mvn spring-boot:run +``` +Application starts on port 9999. Open in Browser: +```sh +localhost:8090 +``` + +## Run Application (DOCKER) +Run Docker Image +```sh +docker run -p 8090:8090 kebidge/hello-rest:jib +``` +Application starts on port `8090`. Open in Browser: +```sh +localhost:8090 +``` + +### Image Details +Type: [Google Jib]\ +Size: `302MB`\ +Compressed Size: `133.38MB`\ +OS/ARCH: `linux/amd64` + +| Description | Size | Comment | +| ------ | ------ | ------ | +| jib-maven-plugin:3.1.4 | 4.32kB | jvm arg files | +| jib-maven-plugin:3.1.4 | 2.38kB | classes | +| jib-maven-plugin:3.1.4 | 3.06kB | resources | +| jib-maven-plugin:3.1.4 | 57.7MB | dependencies | +| /bin/sh -c #(nop) ENV JAVA_HOME=/opt/java/o… | 0B | | +| /bin/sh -c set -eux; ARCH="$(dpkg --prin… | 128MB | | +| /bin/sh -c #(nop) ENV JAVA_VERSION=jdk-11.0… | 0B | | +| /bin/sh -c apt-get update && apt-get ins… | 43.2MB | | +| /bin/sh -c #(nop) ENV LANG=en_US.UTF-8 LANG… | 0B | | +| /bin/sh -c #(nop) CMD ["bash"] | 0B | | +| /bin/sh -c #(nop) ADD file:8d2f4a45a58b3f542… | 72.8MB | | + +## How to use Application +> **_INFO:_** There are 3 REST endpoints implemented + +### Initial Endpoint +```sh +localhost:8090 +``` +or +```sh +localhost:8090/ +``` +> **_OUTPUT:_** Hello World! + +### Kebidge Endpoint +```sh +localhost:8090/kebidge +``` +> **_OUTPUT:_** Hello Kebidge! + +### Personal Endpoint +> **_INFO:_** Set value via endpoint parameter, e.g. `HFT Stuttgart` +```sh +localhost:8090/hello/`HFT Stuttgart` +``` +> **_OUTPUT:_** Hello HFT Stuttgart! diff --git a/src/main/java/de/kebidge/middleware/hellorest/RestInterface.java b/src/main/java/de/kebidge/middleware/hellorest/RestInterface.java index 23ce8fb7b5022074dd232ecee6cee948a48b4f5b..cd4e4ac0d66d894b687dc7ee4a0632ce0a40f6b9 100644 --- a/src/main/java/de/kebidge/middleware/hellorest/RestInterface.java +++ b/src/main/java/de/kebidge/middleware/hellorest/RestInterface.java @@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController class RestInterface { - @RequestMapping + @RequestMapping("/") String helloWorld() { return "Hello World!"; } @@ -20,6 +20,6 @@ class RestInterface { @GetMapping("/hello/{parameter}") public String helloParameter(@PathVariable String parameter) { - return "Hello, " + parameter + "!"; + return "Hello " + parameter + "!"; } } \ No newline at end of file