JXpress is a java based http web server build from scratch. It makes use of the built-in java ServerSocket to communicate with the browser. The request will be parsed to a request object. It will be passed into the callback that is defined for that route. The response returned using the response callback will be sent to the browser.
Below is a small example to get you started. In the example folder are more examples that show more features.
App app = new App();
app.addRoute(Method.GET, "/", req -> new Response().setHTML("Hallo World"));
app.listen(80);-
Routing
-
Header parsing
-
Params parsing
-
XForm parsing
-
Getting raw request body
-
JSON parsing
-
Global & local middleware
-
Text response
-
HTML response
-
JSON stringify response
-
Response Status codes
-
Response headers
Junit is used to make unit test. Most features have unit tests. If you like to contribute to this project and make code changes make sure to run the unit test before making a PR. Unit tests can be found in the test folder.