File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -14,44 +14,53 @@ webserver-basic/
1414 │ └── GreetService.java
1515 ├── pom.xml
1616 └── README.md
17-
1817```
1918##Build
20-
2119Use Maven to compile the project:
2220
21+ ``` shell
2322mvn clean install
23+ ```
2424
25- Run
26-
25+ ##Run
2726Start the WebServer using:
28-
27+ ``` shell
2928java -jar target/webserver-basic.jar
30-
29+ ```
3130
3231The server will start on the default port (8080) unless configured otherwise.
3332
34- Exercise the Application
35-
33+ ##Exercise the Application
3634After the application is running, you can call the available endpoints:
3735
3836Root endpoint
37+ ``` shell
3938curl -X GET http://localhost:8080
39+ ```
4040
4141Greet endpoint
42+ ``` shell
4243curl -X GET http://localhost:8080/greet
44+ ```
4345
4446Personalized greeting
47+ ``` shell
4548curl -X GET http://localhost:8080/greet/{name}
46-
49+ ```
4750
4851This will return:
49- {"message": "Hello {name}!"}
52+ ``` json
53+ {
54+ "message" : " Hello {name}!"
55+ }
56+ ```
5057
5158Update the greeting
59+ ``` shell
5260curl -X PUT -H " Content-Type: application/json" \
5361 -d ' {"greeting": "Hola"}' \
5462 http://localhost:8080/greet/greeting
63+ ```
5564
5665##Notes
5766
You can’t perform that action at this time.
0 commit comments