Commit 144cb2b5 authored by Kutzner's avatar Kutzner 🤸
Browse files

set endpoints

parent 0adcf49c
# 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!
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment