add missing stuff

This commit is contained in:
강남스타일 2023-04-19 11:09:27 +03:00 committed by GitHub
parent c3f63ff55b
commit 4f14721b47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ If you want to make a dynamic response, use ``HttpRequestHandler``
#### Example using ``HttpRequestHandler`` interface
```java
/* new HttpRequestHandler */
new Lumiere((HttpRequest request, HttpResponse response) -> {
new Lumiere((Socket socket, HttpRequest request, HttpResponse response) -> {
  response.setContentType("text/html");
  response.push("<b>"+request.getProperty("User-Agent")+"</b>");
}).bootServer(8080);
@ -61,7 +61,7 @@ You can create multiple pages for your simple server using ``HttpController``
HttpController controller = new HttpController();
controller.addHandler("/", new SimpleResponse("<a href=\"/info\">GO TO INFO</a>", true));
controller.addHandler("/info", new SimpleResponse("Meow", false));
controller.addHandler("/agent", (HttpRequest request, HttpResponse response) -> {
controller.addHandler("/agent", (Socket socket, HttpRequest request, HttpResponse response) -> {
  response.setContentType("text/html");
  response.push("<b>"+request.getProperty("User-Agent")+"</b>");
});