Skip to content

Commit 3fb083b

Browse files
committed
docs: update README formatting with proper shell/json code blocks
1 parent 82877a2 commit 3fb083b

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

examples/webserver/basic/README.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,53 @@ webserver-basic/
1414
│ └── GreetService.java
1515
├── pom.xml
1616
└── README.md
17-
1817
```
1918
##Build
20-
2119
Use Maven to compile the project:
2220

21+
```shell
2322
mvn clean install
23+
```
2424

25-
Run
26-
25+
##Run
2726
Start the WebServer using:
28-
27+
```shell
2928
java -jar target/webserver-basic.jar
30-
29+
```
3130

3231
The server will start on the default port (8080) unless configured otherwise.
3332

34-
Exercise the Application
35-
33+
##Exercise the Application
3634
After the application is running, you can call the available endpoints:
3735

3836
Root endpoint
37+
```shell
3938
curl -X GET http://localhost:8080
39+
```
4040

4141
Greet endpoint
42+
```shell
4243
curl -X GET http://localhost:8080/greet
44+
```
4345

4446
Personalized greeting
47+
```shell
4548
curl -X GET http://localhost:8080/greet/{name}
46-
49+
```
4750

4851
This will return:
49-
{"message": "Hello {name}!"}
52+
```json
53+
{
54+
"message": "Hello {name}!"
55+
}
56+
```
5057

5158
Update the greeting
59+
```shell
5260
curl -X PUT -H "Content-Type: application/json" \
5361
-d '{"greeting": "Hola"}' \
5462
http://localhost:8080/greet/greeting
63+
```
5564

5665
##Notes
5766

0 commit comments

Comments
 (0)