Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.26 KB

File metadata and controls

40 lines (28 loc) · 1.26 KB

JXpress

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.

Getting started

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);

Features

  • 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

Unit tests

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.