Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
kebidge
HelloREST
Commits
144cb2b5
Commit
144cb2b5
authored
3 years ago
by
Kutzner
Browse files
Options
Download
Email Patches
Plain Diff
set endpoints
parent
0adcf49c
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+80
-0
README.md
src/main/java/de/kebidge/middleware/hellorest/RestInterface.java
+2
-2
...n/java/de/kebidge/middleware/hellorest/RestInterface.java
with
82 additions
and
2 deletions
+82
-2
README.md
+
80
-
0
View file @
144cb2b5
# 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!
This diff is collapsed.
Click to expand it.
src/main/java/de/kebidge/middleware/hellorest/RestInterface.java
+
2
-
2
View file @
144cb2b5
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets