Skip to content
This repository has been archived by the owner on May 28, 2023. It is now read-only.

Latest commit

 

History

History
executable file
·
49 lines (43 loc) · 1.83 KB

README.md

File metadata and controls

executable file
·
49 lines (43 loc) · 1.83 KB

logo

EO principles respected here We recommend IntelliJ IDEA

mvn License Hits-of-Code

jPages is an experimental prototype of a web framework, which respects all possible principles of true object-oriented design. More about it in this blog post and in this webinar.

This is how you start a web app:

Thread thread = new Thread(
  () -> {
    App app = new App(
      new Page() {
        @Override
        public Page with(String name, String value) {
            if (value.equals("/")) {
              return new TextPage("Hello, world!");
            }
            return new TextPage("Not found!");
        }
        @Override
        public Output via(Output output) {
          return output.with("X-Body", "Not found");
        }
      }
    );
    try {
      app.start(8080);
    } catch (Exception ex) {
      System.out.println(ex.getMessage());
      throw new IllegalStateException(ex);
    }
  }
);
thread.setDaemon(true);
thread.start();

This repository is read-only now. Check yegor256/takes instead, it's in active development.