Skip to content

Commit 82877a2

Browse files
committed
Fix README: escaped ASCII tree and follow Helidon example format
1 parent 761c80d commit 82877a2

File tree

1 file changed

+37
-87
lines changed

1 file changed

+37
-87
lines changed

examples/webserver/basic/README.md

Lines changed: 37 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,60 @@
1-
🚀 Helidon WebServer Basic Example
1+
##WebServer Basic Example
22

3-
This example demonstrates the simplest possible Helidon SE WebServer application.
4-
It shows how to start a server, define basic routing, handle HTTP requests, and return responses.
3+
This example demonstrates a minimal Helidon WebServer application that starts an HTTP server and exposes simple routes.
54

6-
This is a good starting point for understanding how Helidon SE applications are structured.
5+
##Project Structure
76

8-
📂 Project Structure
9-
basic/
7+
```
8+
webserver-basic/
9+
├── src
10+
│ └── main
11+
│ └── java
12+
│ └── io/helidon/examples/webserver/basic/
13+
│ ├── Main.java
14+
│ └── GreetService.java
1015
├── pom.xml
11-
└── src
12-
├── main
13-
│ ├── java/io/helidon/examples/webserver/basic/BasicMain.java
14-
│ └── resources/logging.properties
15-
└── test
16-
└── java/io/helidon/examples/webserver/basic/
17-
├── AbstractBasicRoutingTest.java
18-
├── BasicRoutingIT.java
19-
└── BasicRoutingTest.java
16+
└── README.md
2017
21-
🧠 What This Example Shows
22-
✔ Start a WebServer
18+
```
19+
##Build
2320

24-
The example configures and starts a Helidon SE WebServer on a selected port.
21+
Use Maven to compile the project:
2522

26-
✔ Define Basic Routing
23+
mvn clean install
2724

28-
It demonstrates simple routing, including:
25+
Run
2926

30-
Returning plain text responses
27+
Start the WebServer using:
3128

32-
Handling HTTP GET endpoints
29+
java -jar target/webserver-basic.jar
3330

34-
Using routing builders
3531

36-
✔ Logging Configuration
32+
The server will start on the default port (8080) unless configured otherwise.
3733

38-
logging.properties shows how Helidon configures Java Util Logging (JUL).
34+
Exercise the Application
3935

40-
✔ Tests Included
36+
After the application is running, you can call the available endpoints:
4137

42-
The example contains:
38+
Root endpoint
39+
curl -X GET http://localhost:8080
4340

44-
Unit tests
41+
Greet endpoint
42+
curl -X GET http://localhost:8080/greet
4543

46-
Integration tests (running an actual WebServer instance)
44+
Personalized greeting
45+
curl -X GET http://localhost:8080/greet/{name}
4746

48-
These tests help verify routing behavior automatically.
4947

50-
▶️ How to Run
51-
Using Maven
48+
This will return:
49+
{"message": "Hello {name}!"}
5250

53-
From the basic directory:
51+
Update the greeting
52+
curl -X PUT -H "Content-Type: application/json" \
53+
-d '{"greeting": "Hola"}' \
54+
http://localhost:8080/greet/greeting
5455

55-
mvn package
56-
java -jar target/basic.jar
56+
##Notes
5757

58+
This example follows the standard Helidon project layout.
5859

59-
Server starts on the default port (usually 8080).
60-
61-
You will see output like:
62-
63-
WEB server started at http://localhost:8080
64-
65-
🔗 Example Endpoints
66-
67-
Once the server is running, try:
68-
69-
GET /greet
70-
curl http://localhost:8080/greet
71-
72-
73-
Response:
74-
75-
Hello World!
76-
77-
78-
If routing includes path parameters, you may also test:
79-
80-
GET /greet/{name}
81-
curl http://localhost:8080/greet/Naveen
82-
83-
84-
Example response:
85-
86-
Hello Naveen!
87-
88-
🧪 Run Tests
89-
mvn test
90-
91-
92-
This executes both:
93-
94-
Unit tests
95-
96-
Integration tests (start WebServer and verify responses)
97-
98-
📘 Useful to Learn
99-
100-
This example helps new users understand:
101-
102-
How to create a minimal Helidon SE service
103-
104-
How routing works
105-
106-
How requests and responses are handled
107-
108-
How Helidon SE applications are structured
109-
110-
How to write integration tests for WebServer applications
60+
For more advanced server features, refer to other examples in the repository.

0 commit comments

Comments
 (0)